我作出如下声明。
#define FUNC_DEC(f) inline void f##(){}
class MyClass
{
public:
FUNC_DEC(a);
FUNC_DEC(b);
};
预处理后,我预计该类看起来像:
class MyClass
{
public:
inline void a(){};
inline void b(){};
};
实际上,我遇到了编译错误
#20 identifier "a" is undefined
#20 identifier "b" is undefined
warnings
Description Resource Path Location Type
#891-D omission of explicit type is nonstandard ("int" assumed)
谁能告诉我我的声明有什么问题?太感谢了。