1

In the list of C++ keywords, there are alternatives for the operators, such as:

&&  and
&=  and_eq
&   bitand
|   bitor
~   compl
!   not
!=  not_eq
||  or
|=  or_eq
^   xor
^=  xor_eq

In fact I personally find:

if(not s.empty())

more intuitive than,

if(!s.empty())

In many scripting language such words are the only option.
Why are not they famous in C++ over the operators? Is there anything to do with coding style or is it just a matter of taste.

PeeHaa
  • 69,318
  • 57
  • 185
  • 258
iammilind
  • 65,167
  • 30
  • 162
  • 315
  • see also http://stackoverflow.com/questions/1103313/is-anybody-using-the-named-boolean-operators – stefaanv May 14 '13 at 07:06
  • @stefaanv, thanks, my question is a duplicate then. Voting to close. – iammilind May 14 '13 at 07:08
  • Python has `not`, but although it defines "magic" methods with names like `__xor__`, they're still called using normal operator syntax. What other scripting languages utilize words over operators? – Yuushi May 14 '13 at 07:09
  • @Yuushi, I know only about Python, just wondered that it might be somewhere else as well. – iammilind May 14 '13 at 07:22

0 Answers0