On Sun, 1 Sep 2013, Richard Sandiford wrote: > like to get rid of them and just keep the genuine operators. The problem > is that I'd have liked the AND routine to be "wi::and", but of course that > isn't possible with "and" being a keyword, so I went for "wi::bit_and" > instead. Same for "not" and "wi::bit_not", and "or" and "wi::bit_or". > Then it seemed like the others should be bit_* too, and "wi::bit_and_not" > just seems a bit unwieldly... > > Hmm, if we decide to forbid the use of "and" in gcc, perhaps we could > #define it to something safe. But that would probably be too confusing.
"and" in C++ is not a keyword, but an alternative token (like %> etc.). As such, it can't be defined as a macro, or used as a macro name in #define, #ifdef etc., and does not get converted to 0 in #if conditions but is interpreted as an operator there. (The status of "new" and "delete" in this regard is less clear; see <http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#369>.) -- Joseph S. Myers jos...@codesourcery.com