std::forward_list
Aus cppreference.com
definiert in Header <forward_list>
|
||
template< class T, |
(seit C++11) | |
Forward List ist ein Container, der schnelles Einfügen und Entfernen von Elementen an jeder Position im Container unterstützt. Schneller Direktzugriff auf einzelne Elemente wird hingegen nicht unterstützt. Der Container ist als einfach verkettete Liste implementiert und weist, verglichen mit der Umsetzung in C, keinen wesentlichen Overhead auf. Im Vergleich zu std::list ist dieser Container eine speichereffiziente Lösung, wenn die bidirektionale Iteration nicht benötigt wird.
std::forward_list
erfüllt die Anforderungen an Container
(mit Ausnahme der size()
-Elementfunktion), AllocatorAwareContainer
und SequenceContainer
.
[Bearbeiten] Member-Typen
Mitglied Typ | Definition |
value_type
|
T
|
allocator_type
|
Allocator
|
size_type
|
vorzeichenloser ganzzahliger Typ (in der Regel size_t) |
difference_type
|
vorzeichenbehafteter Typ (usually ptrdiff_t) |
reference
|
value_type&
|
const_reference
|
const value_type&
|
pointer
|
std::allocator_traits<Allocator>::pointer |
const_pointer
|
std::allocator_traits<Allocator>::const_pointer |
iterator
|
ForwardIterator
|
const_iterator
|
Constant Forward-Iterator
Original: Constant forward iterator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[Bearbeiten] Member-Funktionen
konstruiert die forward_list (öffentliche Elementfunktion) | |
zerstört die forward_list (öffentliche Elementfunktion) | |
weist Werte auf den Behälter 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) | |
weist Werte auf den Behälter 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) | |
liefert den zugehörigen Allocator (öffentliche Elementfunktion) | |
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 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) | |
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 auf das Element vor Beginn Original: returns an iterator to the element before 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) | |
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) | |
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) | |
Original: Capacity The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
prüft, 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) | |
gibt die maximal mögliche 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) | |
Original: Modifiers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
löscht 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) | |
Einsätze Elemente nach einem Element Original: inserts elements after an 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) | |
baut Elemente in-place nach einem Element Original: constructs elements in-place after an 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) | |
löscht ein Element nach einem Element Original: erases an element after an 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) | |
Elemente am Listenanfang einfügen (öffentliche Elementfunktion) | |
Konstruiert Elemente in-place am Anfang Original: constructs elements in-place at 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) | |
entfernt das erste Element Original: removes 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) | |
ändert die Anzahl der gespeicherten Elemente (öffentliche Elementfunktion) | |
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) | |
Original: Operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
vereinigt zwei sortierte Listen (öffentliche Elementfunktion) | |
Elemente aus einem anderen bewegt forward_list Original: moves elements from another forward_list The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (öffentliche Elementfunktion) | |
entfernt Elemente anhand bestimmter Kriterien (öffentliche Elementfunktion) | |
kehrt die Reihenfolge der Elemente um (öffentliche Elementfunktion) | |
entfernt aufeinanderfolgende doppelte Elemente (öffentliche Elementfunktion) | |
sortiert die Elemente Original: sorts the 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) |
[Bearbeiten] Non-Member-Funktionen
lexikographischer Vergleich der Werte in forward_list (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) |