class reference; |
The std::vector<bool>
specialization defines std::vector<bool>::reference
as a publicly-accessible nested class. std::vector<bool>::reference
proxies the behavior of references to a single bit in std::vector<bool>
.
The primary use of std::vector<bool>::reference
is to provide an l-value that can be returned from operator[]
.
Any reads or writes to a vector that happen via a std::vector<bool>::reference
potentially read or write to the entire underlying vector.
(constructor) | constructs the reference. Accessible only to std::vector<bool> itself (public member function) |
(destructor) | destroys the reference (public member function) |
operator= | assigns a bool to the referenced bit (public member function) |
operator bool | returns the referenced bit (public member function) |
flip | flips the referenced bit (public member function) |
~reference() |
Destroys the reference.
reference& operator=( bool x ); reference& operator=( const reference& x ); | (until C++11) | |
reference& operator=( bool x ) noexcept; reference& operator=( const reference& x ) noexcept; | (since C++11) |
Assigns a value to the referenced bit.
x | - | value to assign |
*this
.
operator bool() const; | (until C++11) | |
operator bool() const noexcept; | (since C++11) |
Returns the value of the referenced bit.
(none).
The referenced bit.
void flip(); | (until C++11) | |
void flip() noexcept; | (since C++11) |
Inverts the referenced bit.
(none).
(none).
access specified element (public member function of std::vector ) |
|
[static] | swaps two std::vector<bool>::reference s (public static member function) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/container/vector_bool/reference