The std::vector
<bool, Alloc> specializations define std::vector
<bool, Alloc>::reference as a publicly-accessible nested class. std::vector
<bool, Alloc>::reference proxies the behavior of references to a single bit in std::vector
<bool, Alloc>.
The primary use of std::vector
<bool, Alloc>::reference is to provide an assignable value that can be returned from operator[].
Any reads or writes to a vector that happen via a std::vector
<bool, Alloc>::reference potentially read or write to the entire underlying vector.
reference( const reference& ) = default;
(since C++11)Constructs the reference from another reference. The copy constructor is implicitly declared.(until C++11)
Other constructors can only be accessed by std::vector
<bool, Alloc>.
~reference();
(constexpr since C++20)Destroys the reference.
std::vector<bool, Alloc>::reference::operator=reference& operator=( bool x );
(1) (noexcept since C++11)constexpr const reference& operator=( bool x ) const noexcept;
(2) (since C++23)reference& operator=( const reference& x );
(3) (noexcept since C++11)Assigns a value to the referenced bit.
The const operator= enables std::vector<bool,Alloc>::iterator
to satisfy output_iterator
.
*this
std::vector<bool, Alloc>::reference::operator booloperator bool() const;
(noexcept since C++11)Returns the value of the referenced bit.
Return valueThe referenced bit.
std::vector<bool, Alloc>::reference::flipvoid flip();
(noexcept since C++11)Inverts the referenced bit.
[edit] Helper classes std::formatter<std::vector<bool, Alloc>::reference> template< class T, class CharT > requires /*is-vector-bool-reference*/<T>
Specializes the std::formatter for std::vector
<bool, Alloc>::reference. The specialization uses std::formatter<bool, CharT> as its underlying formatter (denoted as underlying_
) where the referenced bit is converted to bool to be formatted.
The exposition-only constant /*is-vector-bool-reference*/<T> is true if and only if T
denotes the type std::vector
<bool, Alloc>::reference for some type Alloc
and std::vector
<bool, Alloc> is not a program-defined specialization.
template< class ParseContext >
constexpr ParseContext::iterator parse( ParseContext& ctx );
template< class FormatContext >
FormatContext::iterator format( const T& r, FormatContext& ctx ) const;
1) Equivalent to return
underlying_
.parse(ctx);.
2) Equivalent to return
underlying_
.format(r, ctx);.
std::vector<T,Allocator>
) [edit] swaps two std::vector<bool>::
references
std::vector<bool>::reference
).
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4