Yes, this is valid C++ :
if (false or (true and not false)) ...
Among others such as bitand
and xor
. In C, they used to be macros, but now they are keywords ! You can even overload them ! Then why would someone ever teach or write something like :
if (false || (true && !(false))) ...
Why is nobody using them ?
Because they don't allow mixed C/C++ code without including additional header files, are less known to programmers, and it's not immediately clear whether and
is the short-circuit or bitwise version.
Why nobody? Some use them. Others think that symbols are more readable than words.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With