c++ - N4713中的[cpp.cond]/2

标签 c++ language-lawyer c-preprocessor

N4713中的[cpp.cond] / 2:

A defined-macro-expression evaluates to 1 if the identifier is currently defined as a macro name (that is, if it is predefined or if it has been the subject of a #define preprocessing directive without an intervening #undef directive with the same subject identifier), 0 if it is not.



我不了解上面的。也就是说,如何在不使用#define预处理指令的情况下预定义宏名称?

最佳答案

该实现预定义了一些宏,而无需用户对其进行#define。在[cpp.predefined]中可以找到标准预定义宏名称的列表。例如,它包括__FILE____LINE__

关于c++ - N4713中的[cpp.cond]/2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61373828/

相关文章:

C++ 多重继承三角形

c++ - 将指针/引用转换为固定数组大小是否合法

c - 做像 foo(x, &x) 这样的事情安全吗?

c++ - 为什么这个派生类不是标准布局类?

c - 在预处理器中显示之前评估常量

c++ - 链接错误 C++ Libcurl

c++ - GL_TEXTURE_3D 是什么意思?

c++ - 在 std::map 中插入模板化类,并在插入时进行构造

c - 检测字节顺序

c - 嵌套预处理器指令或其他技巧以有条件地重新定义 static 关键字