Name

operator| function template — Performs bitwise inclusive or of two bitsets

Synopsis

template <size_t N>
  bitset<N> operator|(const bitset<N>& a, const bitset<N>& b);

The | operator takes two bitsets and returns a new bitset that represents the bitwise inclusive or of the operands. In other words, an output bit is set when the corresponding bit is set in either operand, and an output bit is reset if the corresponding bits in both operands are 0.

See Also

bitset class template, operator &, operator ^, <cstddef> , bit_or keyword

Get C++ In a Nutshell 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.