1
下面的代码 -如何编写接受类型名称的宏?
#define test_macro (some_typename) some_typename func (some_typename x) {return x;}
test_macro (int)
不与G ++ 4.4.7编译给予下列错误 -
constructor, destructor, or type conversion before 'some_typename'
unqualified-id before 'int'
')' before 'int'
我要去哪里错了?
为什么你在使用宏吗?模板也许? –
@EdHeal test_macro可能被C应用程序使用 – Curious