![](/img/trans.png)
[英]What is the purpose of a single pound/hash sign (#) on its own line in the C/C++ preprocessor?
[英]What does a C++ preprocessor do when there's just a single `#` in a line - and nothing else?
这是 C++ 的有效行吗? 它应该是什么意思?
#
这个如何:
# // a comment
最近的编译器似乎忽略了它,没有错误也没有警告。
它“什么都不做”吗? 我有一个 header 文件,其中在存在此类行的情况下使用 g++ 7.4.0 编译时会出现“兼容性”部分。 在非活动的#if
分支中看到这一行被排除在外的编译器似乎不会出错。
注意:Travis CI 上的 Debian Bionic 上的 gcc 7.4.0 (截至撰写本文时)被此类线路绊倒。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.