如何包装一行预处理器指令并忽略多余的空间?
测试代码:
#error Line0\
Line 1
结果:
short_test.cpp(1): error: #error directive: Line0 Line 1
#error Line0\
^
虽然我想在测试代码中保留缩进模式,但我不想在结果中显示第 0 行和第 1 行之间的间距。
这可能吗?
我想要的结果:
short_test.cpp(1): error: #error directive: Line0Line 1
no space between Line0 and Line1
我想要的测试代码
#error Line0\
(extra stuff?) Line 1 <-- keep the indent, ok to insert some extra stuff.
最佳答案
对不起,你不能。
预处理器将精确地接受您提供的内容,包括任何缩进。
关于c++ - 包装一行预处理器 C++,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39707502/