GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::vector::reference(3) C++ Standard Libary std::vector::reference(3)

std::vector::reference - std::vector::reference


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)

std::vector<bool>::reference::~reference


~reference(); (until C++20)
constexpr ~reference(); (since C++20)


Destroys the reference.

std::vector<bool>::reference::operator=


reference& operator=( bool x ); (until C++11)
reference& operator=( bool x ) noexcept; (since C++11)
(until C++20)
constexpr reference& operator=( bool x ) (since C++20)
noexcept;
reference& operator=( const reference& x ); (1) (until C++11)
reference& operator=( const reference& x ) (since C++11)
noexcept; (until C++20)
constexpr reference& operator=( const reference& (2) (since C++20)
x ) noexcept;
constexpr const reference& operator=( bool x ) (3) (since C++23)
const noexcept;


Assigns a value to the referenced bit.


x - value to assign

Return value


*this

std::vector<bool>::reference::operator bool


operator bool() const; (until C++11)
operator bool() const noexcept; (since C++11)
(until C++20)
constexpr operator bool() const noexcept; (since C++20)


Returns the value of the referenced bit.


(none)

Return value


The referenced bit.

std::vector<bool>::reference::flip


void flip(); (until C++11)
void flip() noexcept; (since C++11)
(until C++20)
constexpr void flip() noexcept; (since C++20)


Inverts the referenced bit.


(none)

Return value


(none)


This section is incomplete
Reason: no example


operator[] access specified element
(public member function of std::vector<T,Allocator>)
swap swaps two std::vector<bool>::references
[static] (public static member function)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.