Espaces de noms
Variantes
Affichages
Actions

operator<<,>>(std::bitset)

De cppreference.com
< cpp‎ | utility‎ | bitset

 
 
 
std::bitset
Types de membres
Original:
Member types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::reference
Les fonctions membres
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::bitset
bitset::operator==
bitset::operator!=
Elément d'accès
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::operator[]
bitset::test
bitset::all
bitset::any
bitset::none
(C++11)

 
bitset::count
Capacité
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::size
Modificateurs
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::operator&=
bitset::operator|=
bitset::operator^=
bitset::operator~
bitset::operator<<=
bitset::operator>>=
bitset::operator<<
bitset::operator>>
bitset::set
bitset::reset
bitset::flip
Conversions
Original:
Conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::to_string
bitset::to_ulong
bitset::to_ullong (C++11)
Tiers fonctions
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
operator&
operator|
operator^
operator<<
operator>>
Classes d'aide
Original:
Helper classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::hash (C++11)
 
template <class CharT, class Traits, size_t N>

std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os,

                                              const bitset<N>& x);
(1)
template <class CharT, class Traits, size_t N>

std::basic_istream<CharT, Traits>& operator>>(std::basic_istream<CharT, Traits>& is,

                                              bitset<N>& x);
(2)
Inserts ou des extraits d'un bitset à partir d'un flux de caractères .
Original:
Inserts or extracts a bitset from a character stream.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
Écrit le x bitset à la os flux de caractères .
Original:
Writes the bitset x to the character stream os.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
Extraits jusqu'à personnages N de is et stocke les caractères de la x bitset .
Original:
Extracts up to N characters from is and stores the characters in the bitset x.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Caractères sont extraits jusqu'à ce que soit
Original:
Characters are extracted until either
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • N caractères ont été lus,
    Original:
    N characters have been read,
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • de fin de fichier se produit dans is, ou
    Original:
    end-of-file occurs in is, or
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • le caractère suivant n'est ni is.widen('0') ni is.widen('1') .
    Original:
    the next character is neither is.widen('0') nor is.widen('1').
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
Si aucun caractère n'est extraite, is.setstate(ios_base::failbit) est appelé .
Original:
If no characters are extracted, is.setstate(ios_base::failbit) is called.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Sommaire

[modifier] Paramètres

os -
le flux de caractères à écrire
Original:
the character stream to write to
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
is -
le flux de caractères à lire
Original:
the character stream to read from
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
x -
l'bitset à lire ou à écrire
Original:
the bitset to be read or written
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Retourne la valeur

Le flux de caractères qui a été opéré, par exemple os ou is .
Original:
The character stream that was operated on, e.g. os or is.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Exemple

#include <bitset>
#include <iostream>
#include <sstream>
 
int main()
{
    std::string bit_string = "001101";
    std::istringstream bit_stream(bit_string);
 
    std::bitset<3> b1;
    bit_stream >> b1;
    std::cout << b1 << '\n';
    std::bitset<8> b2;
    bit_stream >> b2;
    std::cout << b2 << '\n';
}

Résultat :

001
00000101

[modifier] Voir aussi

effectue décalage binaire à gauche et déplacement vers la droite
Original:
performs binary shift left and shift right
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) [edit]