Namensräume
Varianten
Aktionen

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

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

 
 
 
std::bitset
Mitglied Typen
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
Member-Funktionen
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!=
Elementzugriff zerstört
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
Kapazität
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
Modifiers
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)
Non-Member-Funktionen
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-Klassen
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 oder Auszüge a bitset von einem Charakter-Stream .
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)
Schreibt die bitset x dem Charakter Stream os .
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)
Saugt bis zu N Zeichen aus is und speichert die Zeichen in der bitset x .
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.
Zeichen werden bis entweder extrahiert
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 Zeichen gelesen wurden
    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.
  • Ende-der-Datei auftritt is oder
    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.
  • das nächste Zeichen ist weder is.widen('0') noch 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.
Wenn keine Zeichen extrahiert werden, wird is.setstate(ios_base::failbit) genannt .
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.

Inhaltsverzeichnis

[Bearbeiten] Parameter

os -
den Charakter Stream zu schreiben
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 -
den Charakter Stream zu lesen
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 -
die bitset gelesen oder geschrieben werden
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.

[Bearbeiten] Rückgabewert

Die Charakter-Stream, die auf, z. B. betrieben wurde os oder 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.

[Bearbeiten] Beispiel

#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

[Bearbeiten] Siehe auch

führt binäre Verschiebung nach links und rechts schieben
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.

(öffentliche Elementfunktion) [edit]