
irect manipulation of bits that aren't stored as
bit-fields is an arduous and error-prone task. Fortunately, C++ has a set of bitwise operators for this purpose. These operators are widely used in Digital Signal Processing, compression and encryption algorithms, GUI, and other application domains. The following sections introduce the bitwise operators and show how to use them.

How to manipulate strings of bits directly, in an efficient and readable manner?

Use the built-in bitwise operators for setting, clearing, and testing bit strings.