close
名前空間
変種

std::vector<bool>::reference

提供: cppreference.com
 
 
 
 
<tbody> </tbody>
class reference;

std::vector<bool> の特殊化は std::vector<bool>::reference をパブリックにアクセス可能なネストしたクラスとして定義します。 std::vector<bool>::referencestd::vector<bool> 内の単一のビットを参照する動作を代理します。

std::vector<bool>::reference の主な使用方法は operator[] の戻り値となる左辺値を提供することです。

std::vector<bool>::reference を通して発生するベクタへのあらゆる読み書きはベースとなるベクタ全体に対する読み書きとなる可能性があります。

メンバ関数

コンストラクタ
reference を構築します。 std::vector<bool> 自身からのみアクセス可能です
(パブリックメンバ関数)
デストラクタ
reference を破棄します
(パブリックメンバ関数)
operator=
参照先のビットに bool を代入します
(パブリックメンバ関数)
参照先のビットを返します
(パブリックメンバ関数) [edit]
flip
参照先のビットを反転します
(パブリックメンバ関数)

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

<tbody> </tbody> <tbody class="t-dcl-rev "> </tbody><tbody> </tbody>
~reference();
(C++20未満)
constexpr ~reference();
(C++20以上)

reference を破棄します。

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

<tbody> </tbody> <tbody class="t-dcl-rev "> </tbody><tbody> </tbody>
reference& operator=( bool x ); reference& operator=( const reference& x );
(C++11未満)
reference& operator=( bool x ) noexcept; reference& operator=( const reference& x ) noexcept;
(C++11以上)
(C++20未満)
constexpr reference& operator=( bool x ) noexcept; constexpr reference& operator=( const reference& x ) noexcept;
(C++20以上)

参照先のビットに値を代入します。

引数

x - 代入する値

戻り値

*this

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

<tbody> </tbody> <tbody class="t-dcl-rev "> </tbody><tbody> </tbody>
operator bool() const;
(C++11未満)
operator bool() const noexcept;
(C++11以上)
(C++20未満)
constexpr operator bool() const noexcept;
(C++20以上)

参照先のビットの値を返します。

引数

(なし)

戻り値

参照先のビット。

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

<tbody> </tbody> <tbody class="t-dcl-rev "> </tbody><tbody> </tbody>
void flip();
(C++11未満)
void flip() noexcept;
(C++11以上)
(C++20未満)
constexpr void flip() noexcept;
(C++20以上)

参照先のビットを反転します。

引数

(なし)

戻り値

(なし)

関連項目

指定された要素にアクセスします
(std::vector<T,Allocator>のパブリックメンバ関数) [edit]
[静的]
2つの std::vector<bool>::reference を入れ替えます
(パブリック静的メンバ関数) [edit]