bitset::reference class — Proxy class for a bit in a bitset
class reference { friend class bitset; reference( ) public: ~reference( ); reference& operator=(bool x); reference& operator=(const reference&); bool operator~( ) const; operator bool( ) const; reference& flip( ); };
The bitset::reference
class
is a proxy that refers to a single bit in a bitset
. The constructor is private, so
instances can be created only by the bitset
class, particularly by its operator[]
function. The member functions
are:
reference&
operator=
(bool
x)
, reference&
operator=
(const reference& x)
Sets the referenced bit to x
in the underlying bitset
. Returns *this
.
bool
operator~
( )
const
Returns the logical negation of the referenced bit.
operator
bool
( )
const
Returns the value of the referenced bit.
reference&
flip
( )
Toggles the referenced bit in the underlying bitset
. Returns *this
.