libstdc++
std::bitset< _Nb >::reference Class Reference

#include <bitset>

Public Member Functions

 reference (const reference &)=default
constexpr reference & flip () noexcept
constexpr operator bool () const noexcept
constexpr const reference & operator= (bool __x) const noexcept
constexpr reference & operator= (bool __x) noexcept
constexpr reference & operator= (const reference &__j) noexcept
constexpr bool operator~ () const noexcept

Friends

class bitset
constexpr friend void swap (bool &__x, reference __y) noexcept
constexpr friend void swap (reference __x, bool &__y) noexcept
constexpr friend void swap (reference __x, reference __y) noexcept

Detailed Description

template<size_t _Nb>
class std::bitset< _Nb >::reference

This encapsulates the concept of a single bit. An instance of this class is a proxy for an actual bit; this way the individual bit operations are done as faster word-size bitwise instructions.

Most users will never need to use this class directly; conversions to and from bool are automatic and should be transparent. Overloaded operators help to preserve the illusion.

(On a typical system, this bit reference is 64 times the size of an actual bit. Ha.)

Definition at line 874 of file bitset.

Constructor & Destructor Documentation

◆ ~reference()

template<size_t _Nb>
std::bitset< _Nb >::reference::~reference ( )
inlineconstexprnoexcept

Definition at line 896 of file bitset.

Member Function Documentation

◆ flip()

template<size_t _Nb>
reference & std::bitset< _Nb >::reference::flip ( )
inlineconstexprnoexcept

Definition at line 951 of file bitset.

◆ operator bool()

template<size_t _Nb>
std::bitset< _Nb >::reference::operator bool ( ) const
inlineconstexprnoexcept

Definition at line 945 of file bitset.

◆ operator=() [1/3]

template<size_t _Nb>
const reference & std::bitset< _Nb >::reference::operator= ( bool __x) const
inlineconstexprnoexcept

Definition at line 915 of file bitset.

◆ operator=() [2/3]

template<size_t _Nb>
reference & std::bitset< _Nb >::reference::operator= ( bool __x)
inlineconstexprnoexcept

Definition at line 902 of file bitset.

◆ operator=() [3/3]

template<size_t _Nb>
reference & std::bitset< _Nb >::reference::operator= ( const reference & __j)
inlineconstexprnoexcept

Definition at line 928 of file bitset.

◆ operator~()

template<size_t _Nb>
bool std::bitset< _Nb >::reference::operator~ ( ) const
inlineconstexprnoexcept

Definition at line 940 of file bitset.

◆ bitset

template<size_t _Nb>
friend class bitset
friend

Definition at line 876 of file bitset.

◆ swap [1/3]

template<size_t _Nb>
friend void swap ( bool & __x,
reference __y )
friend

Definition at line 978 of file bitset.

◆ swap [2/3]

template<size_t _Nb>
friend void swap ( reference __x,
bool & __y )
friend

Definition at line 969 of file bitset.

◆ swap [3/3]

template<size_t _Nb>
friend void swap ( reference __x,
reference __y )
friend

Definition at line 960 of file bitset.


The documentation for this class was generated from the following file: