21.5. Operator Keywords

The C++ standard provides operator keywords (Fig. 21.4) that can be used in place of several C++ operators. You can use operator keywords if you have keyboards that do not support certain characters such as !, &, ^, ~, |, etc.

Image

Fig. 21.4. Operator keyword alternatives to operator symbols.

Figure 21.5 demonstrates the operator keywords. Microsoft Visual C++ 2010 requires the header <ciso646> (line 4) to use the operator keywords. In GNU C++ and LLVM, the operator keywords are always defined and this header is not required.

 1   // Fig. 21.5: fig21_05.cpp 2   // Demonstrating operator keywords. ...

Get C++11 for Programmers, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.