bitset::operator^=

Realiza una combinación bit a bit de bitsets con la operación exclusiva de OR .

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

Parámetros

  • _Right
    El bitset que se bit a bit combinado con el bitset de destino.

Valor devuelto

El bitset modificado de destino que resulta de la operación exclusiva bit a bit de OR con el bitset especificado como parámetro.

Comentarios

dos bits combinados por el operador de O de la exclusiva devuelven TRUE si por lo menos uno, pero no ambos, bits es TRUE; si no, la combinación devuelve Falso.

Bitsets debe tener el mismo tamaño a ser bit a bit combinado con el operador exclusivo de OR por la función de operador de miembro.

Ejemplo

// 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;
}
  
  
  
  

Requisitos

encabezado: <bitset>

espacio de nombres: std

Vea también

Referencia

bitset Class