std::vector<bool>
Aus 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>| definiert in Header <vector>
|
||
template<class Allocator = std::allocator<bool>> class vector<bool, Allocator>; |
||
std::vector<bool> ist eine platzsparende Spezialisierung std::vector fr die Art bool . Original:
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.
Die Art, wie
std::vector<bool> wird platzsparend (sowie, ob es berhaupt optimiert wird) ist die Umsetzung definiert. Eine mgliche Optimierung beinhaltet koaleszierende Vektorelemente so dass jedes Element ein einzelnes Bit anstelle eines Byte-Gre bool einnimmt .Original:
The manner in which
std::vector<bool> is made space efficient (as well as whether it is optimized at all) is implementation defined. One potential optimization involves coalescing vector elements such that each element occupies a single bit instead of a byte-sized bool.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.
std::vector<bool> verhlt sich hnlich wie std::vector, aber um Platz effizient sein, sie:Original:
std::vector<bool> behaves similarly to std::vector, but in order to be space efficient, it: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.
- Nicht unbedingt ihre Daten in einem einzigen zusammenhngenden Stck Speicher .Original:Does not necessarily store its data in a single contiguous chunk of memory.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Freilegt
std::vector<bool>::referenceals Verfahren zum Zugriff auf einzelne Bits .Original:Exposesstd::vector<bool>::referenceas a method of accessing individual bits.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Nicht
std::allocator_traits::constructverwenden, um Bit-Werte zu konstruieren .Original:Does not usestd::allocator_traits::constructto construct bit values.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Mitglied Typen
Mitglied Typ
Original: Member type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
value_type
|
bool
|
allocator_type
|
Allocator
|
size_type
|
implementierungsabhngig |
difference_type
|
implementierungsabhngig
Original: implementation-defined The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Proxy-Klasse, die einen Verweis auf ein einzelnes bool Original: proxy class representing a reference to a single bool The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (Klasse) | |
const_reference
|
bool
|
pointer
|
Implementierung definiert
Original: implementation-defined The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
const_pointer
|
Implementierung definiert
Original: implementation-defined The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
iterator
|
Implementierung definiert
Original: implementation-defined The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
const_iterator
|
Implementierung definiert
Original: implementation-defined The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
reverse_iterator
|
std::reverse_iterator<iterator>
|
const_reverse_iterator
|
std::reverse_iterator<const_iterator>
|
Member-Funktionen
konstruiert die vector (ffentliche Elementfunktion of std::vector)
| |
zerstrt die vector (ffentliche Elementfunktion of std::vector)
| |
weist Werte auf den Behlter Original: assigns values to the container The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (ffentliche Elementfunktion of std::vector)
| |
weist Werte auf den Behlter Original: assigns values to the container The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (ffentliche Elementfunktion of std::vector)
| |
| liefert den zugehrigen Allocator (ffentliche Elementfunktion of std::vector)
| |
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. | |
Zugriff auf angegebene Element mit berprfung von Grenzen Original: access specified element with bounds checking The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (ffentliche Elementfunktion of std::vector)
| |
Zugriff auf angegebene Element Original: access specified element The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (ffentliche Elementfunktion of std::vector)
| |
Zugriff auf das erste Element Original: access the first element The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (ffentliche Elementfunktion of std::vector)
| |
| Zugriff auf das letzte Element (ffentliche Elementfunktion of std::vector)
| |
Original: Iterators The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
liefert einen Iterator an den Anfang Original: returns an iterator to the beginning The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (ffentliche Elementfunktion of std::vector)
| |
liefert einen Iterator bis zum Ende Original: returns an iterator to the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (ffentliche Elementfunktion of std::vector)
| |
gibt einen umgekehrten Iterator an den Anfang Original: returns a reverse iterator to the beginning The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (ffentliche Elementfunktion of std::vector)
| |
gibt einen umgekehrten Iterator bis zum Ende Original: returns a reverse iterator to the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (ffentliche Elementfunktion of std::vector)
| |
Original: Capacity The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
prft, ob der Container leer ist Original: checks whether the container is empty The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (ffentliche Elementfunktion of std::vector)
| |
liefert die Anzahl der Elemente Original: returns the number of elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (ffentliche Elementfunktion of std::vector)
| |
gibt die maximal mgliche Anzahl von Elementen Original: returns the maximum possible number of elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (ffentliche Elementfunktion of std::vector)
| |
| reserviert Speicher (ffentliche Elementfunktion of std::vector)
| |
gibt die Anzahl der Elemente, die in derzeit zugewiesenen Speicher gehalten werden kann Original: returns the number of elements that can be held in currently allocated storage The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (ffentliche Elementfunktion of std::vector)
| |
Original: Modifiers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
lscht den Inhalt Original: clears the contents The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (ffentliche Elementfunktion of std::vector)
| |
Elemente einfgen Original: inserts elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (ffentliche Elementfunktion of std::vector)
| |
lscht Elemente Original: erases elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (ffentliche Elementfunktion of std::vector)
| |
fgt Elemente am Ende Original: adds elements to the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (ffentliche Elementfunktion of std::vector)
| |
entfernt das letzte Element Original: removes the last element The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (ffentliche Elementfunktion of std::vector)
| |
| ndert die Anzahl der gespeicherten Elemente (ffentliche Elementfunktion of std::vector)
| |
tauscht die Inhalte Original: swaps the contents The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (ffentliche Elementfunktion of std::vector)
| |
vector<bool> ModifikatorenOriginal: vector<bool> specific modifiersThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| flips all the bits (ffentliche Elementfunktion) | |
[statisch] |
Swaps zwei std::vector<bool>::referencesOriginal: swaps two std::vector<bool>::referencesThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (public static Elementfunktion) |
Non-Member-Funktionen
| lexikographischer Vergleich der Werte in vector (Funktions-Template) | |
spezialisiert die std::swap Algorithmus Original: specializes the std::swap algorithm The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (Funktions-Template) | |
Notes
Wenn die Gre des bitset bei der Kompilierung bekannt ist, kann std::bitset verwendet werden, die bietet einen umfangreicheren Satz von Member-Funktionen. Auerdem besteht boost::dynamic_bitset als Alternative zu
std::vector<bool> .Original:
If the size of the bitset is known at compile time, std::bitset may be used, which offers a richer set of member functions. In addition, boost::dynamic_bitset exists as an alternative to
std::vector<bool>.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.