std::bitset<N>::operator<<,<<=,>>,>>= (3) - Linux Manuals
std::bitset<N>::operator<<,<<=,>>,>>=: std::bitset<N>::operator<<,<<=,>>,>>=
NAME
std::bitset<N>::operator<<,<<=,>>,>>= - std::bitset<N>::operator<<,<<=,>>,>>=
Synopsis
bitset<N> operator<<( std::size_t pos ) const; (1)
bitset<N>& operator<<=( std::size_t pos ); (2)
bitset<N> operator>>( std::size_t pos ) const; (3)
bitset<N>& operator>>=( std::size_t pos ); (4)
Performs binary shift left and binary shift right. Zeroes are shifted in.
1-2) Performs binary shift left. The (2) version is destructive, i.e. performs the shift to the current object.
3-4) Performs binary shift right. The (4) version is destructive, i.e. performs the shift to the current object.
Parameters
pos - number of positions to shift the bits
Return value
1,3) new bitset object containing the shifted bits
2,4) *this
Exceptions
(none) (until C++11)
noexcept specification: (since C++11)
noexcept
Example
// Run this code
Output:
See also
operator&= performs binary AND, OR, XOR and NOT
operator|= (public member function)
operator^=
operator~