std::bitset<N>::reference (3) - Linux Manuals
std::bitset<N>::reference: std::bitset<N>::reference
NAME
std::bitset<N>::reference - std::bitset<N>::reference
Synopsis
class reference;
The std::bitset class includes std::bitset::reference as a publicly-accessible nested class. This class is used as a proxy object to allow users to interact with individual bits of a bitset, since standard C++ types (like references and pointers) are not built with enough precision to specify individual bits.
The primary use of std::bitset::reference is to provide an l-value that can be returned from operator[].
Any reads or writes to a bitset that happen via a std::bitset::reference potentially read or write to the entire underlying bitset.
Member functions
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
constructor   (private member function)
 
destructor    (public member function)
 
operator=     (public member function)
 
operator bool (public member function)
 
operator~     (public member function)
 
flip          (public member function)
 std::bitset<N>::reference::~reference
~reference();
Destroys the reference.
 std::bitset<N>::reference::operator=
reference& operator=( bool x );                              (until C++11)
reference& operator=( bool x ) noexcept;             (1)     (since C++11)
reference& operator=( const reference& x );              (2)               (until C++11)
reference& operator=( const reference& x ) noexcept;                       (since C++11)
Assigns a value to the referenced bit.
Parameters
x - value to assign
Return value
*this
 std::bitset<N>::reference::operator bool
operator bool() const;           (until C++11)
operator bool() const noexcept;  (since C++11)
Returns the value of the referenced bit.
Parameters
(none)
Return value
The referenced bit.
 std::bitset<N>::reference::operator~
bool operator~() const;           (until C++11)
bool operator~() const noexcept;  (since C++11)
Returns the inverse of the referenced bit.
Parameters
(none)
Return value
The inverse of the referenced bit.
 std::bitset<N>::reference::flip
reference& flip();           (until C++11)
reference& flip() noexcept;  (since C++11)
Inverts the referenced bit.
Parameters
(none)
Return value
*this
See also
 
operator[] (public member function)