bitset::reset
Reimposta tutti i bit in un bitset su 0 o su reimposta un bit in un percorso specificato a 0.
bitset<N>& reset( );
bitset<N>& reset(
size_t _Pos
);
Parametri
- _Pos
La posizione di bit in bitset da reimpostare su 0.
Valore restituito
Una copia di bitset per cui la funzione membro è stata richiamata.
Note
La seconda funzione membro genera un'eccezione di out_of_range se la posizione specificata supera le dimensioni di bitset.
Esempio
// bitset_reset.cpp
// compile with: /EHsc
#include <bitset>
#include <iostream>
int main( )
{
using namespace std;
bitset<5> b1 ( 13 );
cout << "The set of bits in bitset<5> b1(13) is: ( "<< b1 << " )"
<< endl;
bitset<5> b1r3;
b1r3 = b1.reset( 2 );
cout << "The collecion of bits obtained from resetting the\n"
<< " third bit of bitset b1 is: ( "<< b1r3 << " )"
<< endl;
bitset<5> b1r;
b1r = b1.reset( );
cout << "The collecion of bits obtained from resetting all\n"
<< " the elements of the bitset b1 is: ( "<< b1r << " )"
<< endl;
}
Requisiti
bitset <diIntestazione: >
Spazio dei nomi: std