Or fields in bitset : bitset and or « bitset « C++ Tutorial






#include <bitset>
#include <iostream>

using namespace std;

int main( ){
   const int num_lights = 15;
   const bitset<num_lights> outside( 0xf );
   const bitset<num_lights> inside( 0xff0 );
   const bitset<num_lights> driveway( 0x7000 );

   bitset<num_lights> lights;
   cout << lights;
   lights |= outside;
   cout  << lights;
}








18.3.bitset and or
18.3.1.Result of XOR between the two sequences
18.3.2.Result of OR between the two sequences
18.3.3.Bitset 'and', and shift operators
18.3.4.Result of AND between the two sequences
18.3.5.Or fields in bitset