cpp/utility/bitset/reference

The std class includes std 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 is to provide an lvalue that can be returned from.

Any reads or writes to a bitset that happen via a std potentially read or write to the entire underlying bitset.

Member functions
{{member | {{small|std::bitset::reference::}}operator{{=}} | {{dcl begin}} {{dcl rev multi | num=1 | until1=c++11 | dcl1= reference& operator=( bool x ); reference& operator=( bool x ) noexcept; constexpr reference& operator=( bool x ) noexcept; }} {{dcl rev multi | num=2 | until1=c++11 | dcl1= reference& operator=( const reference& x ); reference& operator=( const reference& x ) noexcept; constexpr reference& operator=( const reference& x ) noexcept; }} {{dcl end}}
 * until2=c++23 | dcl2=
 * dcl3=
 * until2=c++23 | dcl2=
 * dcl3=

Assigns a value to the referenced bit.

Return value
}}

{{member | {{small|std::bitset::reference::}}operator bool | {{dcl begin}} {{dcl rev multi | until1=c++11 | dcl1= operator bool const; operator bool const noexcept; constexpr operator bool const noexcept; }} {{dcl end}}
 * until2=c++23 | dcl2=
 * dcl3=

Returns the value of the referenced bit.

Parameters
(none)

Return value
The referenced bit. }}

{{member | {{small|std::bitset::reference::}}operator~ | {{dcl begin}} {{dcl rev multi | until1=c++11 | dcl1= bool operator~ const; bool operator~ const noexcept; constexpr bool operator~ const noexcept; }} {{dcl end}}
 * until2=c++23 | dcl2=
 * dcl3=

Returns the inverse of the referenced bit.

Parameters
(none)

Return value
The inverse of the referenced bit. }}

{{member | {{small|std::bitset::reference::}}flip | {{dcl begin}} {{dcl rev multi | until1=c++11 | dcl1= reference& flip; reference& flip noexcept; constexpr reference& flip noexcept; }} {{dcl end}}
 * until2=c++23 | dcl2=
 * dcl3=

Inverts the referenced bit.

Parameters
(none)

Return value
}}