When did “and” become an operator in C++

后端 未结 7 1150
后悔当初
后悔当初 2020-12-05 18:00

I have some code that looks like:

static const std::string and(\" AND \");

This causes an error in g++ like so:

Row.cpp:140         


        
7条回答
  •  离开以前
    2020-12-05 18:09

    I don't know when it was introduced, it may well have been there from the beginning, but I believe the reason it's there is as an alternative to && for people with restricted character sets i.e. where they don't actually have the ampersand character.

    There are many others too eg. and_eq, or, compl and not to name just a selection.

提交回复
热议问题