名前空間
変種
操作

std::bitset<N>::reference

提供: cppreference.com
< cpp‎ | utility‎ | bitset
 
 
ユーティリティライブラリ
汎用ユーティリティ
日付と時間
関数オブジェクト
書式化ライブラリ(C++20)
(C++11)
関係演算子 (C++20で非推奨)
整数比較関数
(C++20)
スワップと型操作
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
一般的な語彙の型
(C++11)
(C++17)
(C++17)
(C++17)
(C++17)

初等文字列変換
(C++17)
(C++17)
 
 
class reference;

std::bitset クラスはパブリックにアクセス可能なネストしたクラスとして std::bitset::reference を含みます。 標準の C++ の型 (参照やポインタなど) は個々のビットを指定できる精度を持たないため、ユーザがビットセットの個々のビットを扱うことを可能にするためのプロキシオブジェクトとしてこのクラスが使用されます。

std::bitset::reference の主な用途は operator[] から返すことのできる左辺値を提供することです。

std::bitset::reference を通して発生するビットセットへのあらゆる読み書きはベースとなるビットセット全体を読み書きする可能性があります。

目次

[編集]メンバ関数

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

std::bitset<N>::reference::~reference

~reference();

reference を破棄します。

std::bitset<N>::reference::operator=

(1)
reference& operator=(bool x );
(C++11未満)
reference& operator=(bool x )noexcept;
(C++11以上)
(2)
reference& operator=(const reference& x );
(C++11未満)
reference& operator=(const reference& x )noexcept;
(C++11以上)

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

引数

x - 代入する値

戻り値

*this

std::bitset<N>::reference::operator bool

operator bool()const;
(C++11未満)
operator bool()constnoexcept;
(C++11以上)

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

引数

(なし)

戻り値

参照先のビット。

std::bitset<N>::reference::operator~

bool operator~()const;
(C++11未満)
bool operator~()constnoexcept;
(C++11以上)

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

引数

(なし)

戻り値

参照先のビットの反転。

std::bitset<N>::reference::flip

reference& flip();
(C++11未満)
reference& flip()noexcept;
(C++11以上)

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

引数

(なし)

戻り値

*this

[編集]関連項目

特定のビットにアクセスします
(パブリックメンバ関数)[edit]
close