c++ - Visual Studio 2013 中的替代标记(不,和等...)

标签 c++ visual-studio-2013

“not”、“and”等是 C++ 中的关键字(C 中的宏)。有没有办法在 Visual Studio 2013 中“启用”它们?我可以将单词用作包含 iso646.h 的宏。但是 VS 似乎无法将它们识别为关键字。

最佳答案

使用 /Za 似乎可以在不包含 iso646.h 的情况下启用它们,see it live , 以下程序在不使用 /Za 的情况下产生错误,但在其他情况下工作正常:

int main()
{
    int x = 1, y = 0 ;
    if (x and y)    
    {
    //...  
    }

    return 0;
}

如 ta.speot.is 所示 /Za禁用扩展,以下 documentation表示您必须包含 ios646.h 否则:

Under /Ze, you have to include iso646.h if you want to use text forms of the following operators:

它在下面列出了替代标记。

请注意,我知道我之前看到过这个,我包含一个指向 bug report for this 的链接在 my answer到一个类似的问题。尽管这不包括上述解决方法。

注2:干杯和hth。 - Alf 表示关闭扩展可能会产生许多不良后果,因此您最好只包含 iso646.h

关于c++ - Visual Studio 2013 中的替代标记(不,和等...),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49859662/

相关文章:

c# - LightInject 入门

c# - 使用自定义域调试 Azure 网站

c++ - 以二进制模式从文件中读取 block 到缓冲区并将该缓冲区写入另一个文件

C++模板类迭代器错误

c++ - Visual Studio 2008 导航栏困惑

c - 在 64 位 Windows 上从 CMD 调用 cl (Visual Studio 2013) 交叉编译器

c# - Visual Studio C++ 类库中的回调

mysql - 如何从另一台PC在线连接到MySQL数据库?网络

c++ - 遍历所有驱动器?

c++ - 在 Spirit:Qi 中构建自定义表达式树(没有 Utree 或 Boost::Variant)