我正在尝试进行一些代码生成。
当我想用参数设置返回值的类型时,编译失败。为什么编译器返回错误?
#define MODULE_GETTER(module_type, interface_type) \
public: \
static #interface_type * Instance##interface_type (void) \
{ \
return NULL;\
}
class MyModuleType :
public IMyModuleInterface
{
MODULE_GETTER(MyModuleType,IMyModuleInterface)
private:
...
};
当我更改static #interface_type *
为static int *
或任何其他预定义类型时,代码编译不会出错。
我究竟做错了什么?