简体   繁体   English

包装一行预处理器C ++

[英]Wrapping a line of preprocessor C++

How to wrap a line of preprocessor directive and ignore extra space? 如何包装一行预处理器指令并忽略额外的空间?

Test Code: 测试代码:

    #error Line0\
    Line 1

Result: 结果:

short_test.cpp(1): error: #error directive: Line0    Line 1
      #error Line0\
       ^

While I want to keep the indent pattern in the test code, I don't want the spacing between line0 and line1 in the result. 虽然我想在测试代码中保留缩进模式,但我不希望结果中的line0和line1之间的间距。

Is that possible? 那可能吗?

Result that I want: 我想要的结果:

short_test.cpp(1): error: #error directive: Line0Line 1
no space between Line0 and Line1

Test Code that I want 我想要的测试代码

    #error Line0\
    (extra stuff?) Line 1  <-- keep the indent, ok to insert some extra stuff.

You can't, sorry. 你不能,抱歉。

The preprocessor will take precisely what you give it, including any indentation. 预处理器将精确地提供您提供的内容,包括任何缩进。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM