VisualStudio 2013中的替代标记(not,and,etc ...) [英] Alternative tokens (not, and, etc...) in VisualStudio 2013

查看:197
本文介绍了VisualStudio 2013中的替代标记(not,and,etc ...)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

not,and等等是C ++中的关键字(C中的宏)。有什么办法在Visual Studio 2013中启用他们吗?我可以使用包含 iso646.h 的宏作为宏。但是VS似乎不能将它们识别为关键字。

The "not", "and", etc... are keywords in C++ (macros in C). Is there any way to "enable" them in Visual Studio 2013? I'm able to use the words as macroses with iso646.h included. But VS seems not be able to recognize them as keywords.

推荐答案

使用 / Za 似乎可以让他们不包括 iso646.h 观看直播,以下程序在不使用 / Za 的情况下产生错误,但会正常工作:

Using /Za seems to enable them without including iso646.h, see it live, the following program produces an error without using /Za but works fine otherwise:

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

    return 0;
}

As ta.speot.is表示 / Za 禁用扩展,以下文档表示您必须包括 ios646.h 否则:

As ta.speot.is indicates /Za disables extensions, the following documentation indicates you must include ios646.h otherwise:


在/ Ze下,如果要使用以下运算符的文本形式,则必须包含iso646.h:

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

并列出下面的替代令牌。

and it lists the alternative tokens below.

注意,我知道我之前看到过,我包括一个此报告的错误报告< a>在我的回答一个类似的问题。虽然这不包括上述解决方法。

Note, I knew I saw this before, I include a link to a bug report for this in my answer to a similar question. Although this does not include the workaround noted above.

注意2:干杯和hth。 - Alf表示关闭扩展可能会有许多不良后果,因此你可能会更好地只是包括 iso646.h

Note 2: Cheers and hth. - Alf indicates that there may be many undesirable consequences to turning off extension and therefore you may be better off just including iso646.h.

这篇关于VisualStudio 2013中的替代标记(not,and,etc ...)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆