【发布时间】:2014-02-10 10:00:38
【问题描述】:
我想根据是否使用-std=c++0x 来定义一个宏。
如果我尝试下面的宏,我会遇到错误error stray '#' in program。
下面的代码是否不正确/是否允许 C++ 在 #define 中使用预处理器 #if / #endif ?
#define DEF_ME (p) \
#if __GXX_EXPERIMENTAL_CXX0X__ \
#endif
我在 Linux 中使用 g++ 4.4.7。
【问题讨论】:
标签: c++ macros g++ c-preprocessor