E. Other Operators
To avoid terminal obesity, the main text of this book doesn’t cover three groups of operators. The first group consists of the bitwise operators, which let you manipulate individual bits in a value; these operators were inherited from C. The second group consists of two-member dereferencing operators; they are C++ additions. The third group includes operators added by C++11: alignof
and noexcept
. This appendix briefly summarizes these operators.
Bitwise Operators
The bitwise operators operate on the bits of integer values. For example, the left-shift operator moves bits to the left, and the bitwise negation operator turns each 1
to a 0
and each 0
to a 1
. Altogether, C++ has six such operators: <<
, >>
, ~
, &
, |
, and ^
.
Get C++ Primer Plus now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.