Namespace
Varianti

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

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

 
 
Utilità libreria
Tipo di supporto (basic types, RTTI, type traits)
Gestione della memoria dinamica
La gestione degli errori
Programma di utilità
Funzioni variadic
Data e ora
Funzione oggetti
initializer_list(C++11)
bitset
hash(C++11)
Gli operatori relazionali
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Coppie e tuple
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
Swap, in avanti e spostare
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
std::bitset
Membri tipi
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
Membri funzioni
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!=
Elemento accesso
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
Modificatori
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
Conversioni
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)
Non membri funzioni
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>>
Helper classi
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)
Inserisce o estratti di un bitset da un flusso di caratteri.
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)
Scrive il x bitset alla os flusso di caratteri.
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)
Estratti fino a caratteri N da is e memorizza i caratteri del 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.
I caratteri vengono estratti fino a quando
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 caratteri sono stati letti,
    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.
  • end-of-file avviene in is, o
    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.
  • il carattere successivo non è né is.widen('0')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.
Se non i caratteri vengono estratti, is.setstate(ios_base::failbit) si chiama.
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.

Indice

[modifica] Parametri

os -
flusso di caratteri in cui scrivere
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 -
flusso di caratteri da leggere
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 per essere letto o scritto
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.

[modifica] Valore di ritorno

Il flusso di caratteri che è stata operata, ad esempio os o 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.

[modifica] Esempio

#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';
}

Output:

001
00000101

[modifica] Vedi anche

esegue spostamento a sinistra binario e spostamento a destra
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.

(membro pubblico funzione) [edit]