The iso646.h header file specifies alternative spellings for some common operators. For example, it uses the keyword and as a substitute for the logical operator &&.

Here’s how the following condition can be expressed using these alternatives:

1
2
3
if (x > 6 and x < 12)
// is equivalent to
if (x > 6 && x < 12)

The defined alternative spellings are as follows:

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