bitset::reset
Obnoví všechny bity bitset na hodnotu 0 nebo obnoví trochu na určené pozici 0.
bitset<N>& reset( );
bitset<N>& reset(
size_t _Pos
);
Parametry
- _Pos
Pozice je bit v bitset na nastavena na 0.
Vrácená hodnota
Kopie bitset, pro které byla vyvolána členskou funkci.
Poznámky
Vyvolá druhou členskou funkci out_of_range výjimku, pokud je větší než velikost bitset zadanou pozici.
Příklad
// 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;
}
Požadavky
Záhlaví:<bitset>
Obor názvů: std