std::bitset::reset
De cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
<tbody> </tbody> bitset<N>& reset(); |
(1) | |
bitset<N>& reset( size_t pos ); |
(2) | |
Définit les bits à
false .Original:
Sets bits to
false.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
1)
Règle tous les bits à
falseOriginal:
Sets all bits to
falseThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
2)
Définit le bit à la position
pos à false .Original:
Sets the bit at position
pos to false.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Paramètres
| pos | - | la position du bit à définir
Original: the position of the bit to set The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Retourne la valeur
*this
Exceptions
1)
2)
lancers std::out_of_range si
pos ne correspondent pas à une position valide dans le bitsetOriginal:
throws std::out_of_range if
pos does not correspond to a valid position within the bitsetThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Exemple
#include <iostream>
#include <bitset>
int main()
{
std::bitset<8> b(42);
std::cout << "Bitset is " << b << '\n';
b.reset(1);
std::cout << "After b.reset(1): " << b << '\n';
b.reset();
std::cout << "After b.reset(): " << b << '\n';
}
Résultat :
Bitset is 00101010
After b.reset(1): 00101000
After b.reset(): 00000000
Voir aussi
définit les bits à true ou valeur donnéeOriginal: sets bits to true or given valueThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction membre publique) | |
alterner les valeurs de bits Original: toggles the values of bits The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction membre publique) |