Trigraphs 不能用 MS 编译器编译?
我在 Visual Studio 2019 中有一个使用 Microsoft 编译器的 C++14 项目,我试图理解二合字母和三合字母,所以我的代码有点奇怪:
#include "Trigraphs.h"
void Trigraphs::assert_graphs()
??<
// How does this ever compile ????/
ouch!
??>
阅读有关 /Zc:三字母 开关
通过 C++14,像 C 中一样支持三字母。C++17 标准从 C++ 语言中删除了三字母。
我知道三字母组应该在 C++14 之前得到支持,因为它们仅在 C++17 中被删除。然而,在我添加额外的命令行开关之前,上述代码不会使用 C++14 设置进行编译。我的母语不是英语,我对“C++14 之前支持三字母”这句话有什么问题吗?
I have a C++14 project withe the Microsoft compiler in Visual Studio 2019 and I'm trying to understand Digraphs and Trigraphs, so my code is a bit weird:
#include "Trigraphs.h"
void Trigraphs::assert_graphs()
??<
// How does this ever compile ????/
ouch!
??>
Reading about the /Zc:trigraphs switch
Through C++14, trigraphs are supported as in C. The C++17 standard removes trigraphs from the C++ language.
I understand that trigraphs should be supported until C++14 because they were removed in C++17 only. Yet, the above code does not compile with C++14 settings until I add the additional command line switch. I am not a native English speaker, did I get something wrong about the sentence that trigraphs are supported until C++14?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MSDN 还说:
,并且似乎已经适用于 C++14。尽管这会导致非 100% 一致的 C++ 编译,但大多数程序员实际上宁愿不处理 C++ 三字母组的奇怪符号。
MSDN also says:
and that seems to apply for C++14 already. Although that results in a non 100% conformant C++ compilation, most programmers will actually prefer not dealing with the strange symbols of C++ trigraphs.