Is it possible to turn off support for “and” / “or” boolean operator usage in gcc?

后端 未结 4 2049
忘了有多久
忘了有多久 2020-12-11 06:15

GCC seems to allow \"and\" / \"or\" to be used instead of \"&&\" / \"||\" in C++ code; however, as I expected, many compilers (notably MSVC 7) do not support this. T

4条回答
  •  忘掉有多难
    2020-12-11 07:10

    The words are standard in C++ without the inclusion of any header.

    The words are standard in C if you include the header .

    MSVC is doing you no service by not supporting the standards.

    You could, however, use tools to enforce the non-use of the keywords. And it can be a coding guideline, and you can quickly train your team not to make silly portability mistakes. It isn't that hard to avoid the problem.

提交回复
热议问题