Condividi tramite


bitset::none

Test se nessun bit è stato impostato su 1 in un oggetto di bitset.

bool none( ) const;

Valore restituito

true se nessun bit in bitset è stato impostato su 1; false se almeno un bit è stato impostato su 1.

Esempio

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

int main( )
{
   using namespace std;

   bitset<5> b1 ( 6 );
   bool b, rb;

   cout << "Original bitset b1(6) is: ( " << b1 << " )"
        << endl;

   b = b1.none ( );

   if ( b )
      cout << "None of the bits in bitset b1 are set to 1."
           << endl;
   else
      cout << "At least one of the bits in bitset b1 is set to 1."
           << endl;
   
   bitset<5> rb1;
   rb1 = b1.reset ( );
   rb = rb1.none ( );
   if ( rb )
      cout << "None of the bits in bitset b1 are set to 1."
           << endl;
   else
      cout << "At least one of the bits in bitset b1 is set to 1."
           << endl;
}
  
  

Requisiti

intestazione: <bitset>

Spazio dei nomi: deviazione standard

Vedere anche

Riferimenti

bitset Class