名前空間
変種
操作

operator&,|,^(std::bitset)

提供: 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> operator&( const bitset<N>& lhs, const bitset<N>& rhs );
(1)
bitset<N> operator|( const bitset<N>& lhs, const bitset<N>& rhs );
(2)
bitset<N> operator^( const bitset<N>& lhs, const bitset<N>& rhs );
(3)
バイナリのAND、OR、および2ビット集合の間のXORを行い、lhsrhs.
Original:
Performs binary AND, OR, and XOR between two bitsets, lhs and rhs.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
バイナリの結果を含むbitset<N>を返し、lhsのビットとrhsの対応するペアに.
Original:
Returns a bitset<N> containing the result of binary AND on corresponding pairs of bits of lhs and rhs.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
バイナリの結果を含むbitset<N>を返すか、またはlhsのビットとrhsの対応するペアに.
Original:
Returns a bitset<N> containing the result of binary OR on corresponding pairs of bits of lhs and rhs.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
bitset<N>のビットとlhsの対応するペアにバイナリのXORの結果を含むrhsを返します。.
Original:
Returns a bitset<N> containing the result of binary XOR on corresponding pairs of bits of lhs and rhs.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

lhs -
演算子の左側にbitsetの
Original:
the bitset on the left-hand side of the operator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rhs -
演算子の右側のbitsetの
Original:
the bitset on the right-hand side of the operator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

1)
{{{1}}}
Original:
{{{2}}}
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
{{{1}}}
Original:
{{{2}}}
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
{{{1}}}
Original:
{{{2}}}
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 例外

noexcept specification:  
noexcept
  (C++11およびそれ以降)

[編集]

#include <bitset>
#include <iostream>
 
int main()
{
    std::bitset<4> b1("0110");
    std::bitset<4> b2("0011");
    std::cout << "b1 & b2: " << (b1 & b2) << '\n';
    std::cout << "b1 | b2: " << (b1 | b2) << '\n';
    std::cout << "b1 ^ b2: " << (b1 ^ b2) << '\n';
}

Output:

b1 & b2: 0010
b1 | b2: 0111
b1 ^ b2: 0101

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

バイナリのAND、OR、XORとNOTを実行します
Original:
performs binary AND, OR, XOR and NOT
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

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