Udostępnij za pośrednictwem


bitset::operator^=

Wykonuje logiczną kombinacji bitsets z wyłącznego OR operacji.

bitset<N>& operator^=(
   const bitset<N>& _Right
);

Parametry

  • _Right
    Bitset, który ma być bitowe połączone z bitset docelowej.

Wartość zwracana

Bitset docelowej zmodyfikowanej, wynikającą z bitowym wyłącznego OR operacji bitset określony jako parametr.

Uwagi

Dwa bity połączone przez wyłącznego lub zwrotu operator true Jeśli co najmniej jeden, ale nie oba bity jest true; w przeciwnym razie zwraca ich kombinacja false.

Bitsets muszą być tego samego rozmiaru bitowe łączyć z wyłącznego OR operatora przez funkcję Członkowskie operatora.

Przykład

// bitset_op_bitwiseOR.cpp
// compile with: /EHsc
#include <bitset>
#include <iostream>

int main( )
{
   using namespace std;
   bitset<5> b1 ( 7 );
   bitset<5> b2 ( 11 );
   bitset<4> b3 ( 7 );

   cout << "The target bitset b1 is:    ( "<< b1 << " )." << endl;
   cout << "The parameter bitset b2 is: ( "<< b2 << " )." << endl;
   cout << endl;

   b1 ^= b2;
   cout << "After bitwise exclusive OR combination,\n"
        << " the target bitset b1 becomes:   ( "<< b1 << " )." 
        << endl;

   // Note that the parameter-specified bitset in unchanged
   cout << "The parameter bitset b2 remains: ( "<< b2 << " )." 
        << endl;

   // The following would cause an error because the bisets 
   // must be of the same size to be combined
   // b1 |= b3;
}
  
  
  
  

Wymagania

Nagłówek: <bitset>

Obszar nazw: std

Zobacz też

Informacje

bitset Class