名前空間
変種
操作

std::bitset::operator&=,|=,^=,~

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

 
 
 
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>& other );
(1)
bitset<N>& operator|=( const bitset<N>& other );
(2)
bitset<N>& operator^=( const bitset<N>& other );
(3)
bitset<N> operator~() const;
(4)
バイナリの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.
1)
バイナリのAND*thisotherのビットの対応するペアの結果にビットを設定します。.
Original:
Sets the bits to the result of binary AND on corresponding pairs of bits of *this and other.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
バイナリのOR*thisotherのビットの対応するペアの結果にビットを設定します。.
Original:
Sets the bits to the result of binary OR on corresponding pairs of bits of *this and other.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
*thisのビットとotherの対応するペア上のバイナリのXORの結果にビットを設定します。.
Original:
Sets the bits to the result of binary XOR on corresponding pairs of bits of *this and other.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
4)
(バイナリではなく)すべてのビットを反転し*thisの一時的なコピーを返します。.
Original:
Returns a temporary copy of *this with all bits flipped (binary NOT).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
{{{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.

目次

[編集] パラメータ

other -
別のBitSet
Original:
another bitset
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

1-3) *this

4)
すべてのビットを持つ一時bitsetの<N>は反転
Original:
a bitset<N> temporary with all bits flipped
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 <string>
#include <bitset>
 
int main()
{
    std::bitset<16> dest;
    std::string pattern_str = "1001";
    std::bitset<16> pattern(pattern_str);
 
    for (size_t i = 0, ie = dest.size()/pattern_str.size(); i != ie; ++i) {
        dest <<= pattern_str.size();
        dest |= pattern;
    }
    std::cout << dest << '\n';
}

出力:

1001100110011001

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

右バイナリシフトと左シフトを実行します
Original:
performs binary shift left and shift right
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

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