名前空間
変種
操作

std::bitset::set

提供: cppreference.com
< cpp‎ | utility‎ | bitset

 
 
ユーティリティライブラリ
支援を入力します (basic types, RTTI, type traits)
動的なメモリ管理
エラー処理
プログラムユーティリティ
可変個引数関数
日付と時刻
関数オブジェクト
initializer_list(C++11)
bitset
hash(C++11)
関係演算子
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
ペアとタプル
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
フォワード、スワップ、および移動
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
std::bitset
メンバータイプ
Original:
Member types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::reference
メンバ関数
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::bitset
bitset::operator==
bitset::operator!=
要素アクセスの循環参照を解除するために使用されている
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::operator[]
bitset::test
bitset::all
bitset::any
bitset::none
(C++11)

 
bitset::count
容量
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::size
修飾子
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::operator&=
bitset::operator|=
bitset::operator^=
bitset::operator~
bitset::operator<<=
bitset::operator>>=
bitset::operator<<
bitset::operator>>
bitset::set
bitset::reset
bitset::flip
変換
Original:
Conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::to_string
bitset::to_ulong
bitset::to_ullong(C++11)
非メンバ関数
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
operator&
operator|
operator^
operator<<
operator>>
ヘルパークラス
Original:
Helper classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::hash(C++11)
 
bitset<N>& set();
(1)
bitset<N>& set( size_t pos, bool value = true );
(2)
trueに、指定された値のすべてのビットを設定します。.
Original:
Sets all bits to true or to specified value.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
trueにすべてのビットを設定します
Original:
Sets all bits to true
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
posに位置valueのビットを設定します.
Original:
Sets the bit at position pos to the value value.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

pos -
設定するビットの位置
Original:
the position of the bit to set
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
value -
ビットを設定する値
Original:
the value to set the bit to
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

*this

[編集] 例外

1)
noexcept specification:  
noexcept
  (C++11およびそれ以降)
2)
std::out_of_rangebitsetの内の有効な位置に対応していない場合posをスロー.
Original:
throws std::out_of_range if pos does not correspond to a valid position within the bitset.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集]

#include <iostream>
#include <bitset>
 
int main()
{
    std::bitset<8> b;
    for (size_t i = 1; i < b.size(); i += 2) {
        b.set(i);
    }
    std::cout << b << '\n';
}

Output:

10101010

[編集] も参照してください

falseにビットを設定します
Original:
sets bits to false
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
ビットの値を切り替えることができます
Original:
toggles the values of bits
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]