std::bitset::operator&=,|=,^=,~

From Cppreference

Jump to: navigation, search
bitset<N>& operator&=( const bitset<N>& other );
(1)
bitset<N>& operator|=( const bitset<N>& other );
(2)
bitset<N>& operator^=( const bitset<N>& other );
(3)
bitset<N> operator~() const;
(4)

Performs binary AND, OR, XOR and NOT.

1) Sets the bits to the result of binary AND on corresponding pairs of bits of *this and other.

2) Sets the bits to the result of binary OR on corresponding pairs of bits of *this and other.

3) Sets the bits to the result of binary XOR on corresponding pairs of bits of *this and other.

4) Returns a temporary copy of *this with all bits flipped (binary NOT).

Contents

[edit] Parameters

other - another bitset

[edit] Return value

1-3) *this

4) a bitset<N> temporary with all bits flipped

[edit] Example

[edit] See also

operator<<=
operator>>=
operator<<
operator>>
performs binary shift left and shift right
(public member function)