std::deque::push_back
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. |
void push_back(const T& value ); | ||
void push_back( T&& value ); | (seit C++11) | |
Hängt den gegebenen Element
value
an das Ende des Behälters . Original:
Appends the given element
value
to the end of the container. 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.
All iterators are invalidated. No references are invalidated.
Inhaltsverzeichnis |
[Bearbeiten]Parameter
value | - | der Wert des Elements, anzuhängen Original: the value of the element to append The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[Bearbeiten]Anforderungen
1)value
wird CopyInsertable
seinOriginal:
value
shall be CopyInsertable
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.
value
wird MoveInsertable
seinOriginal:
value
shall be MoveInsertable
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.
[Bearbeiten]Rückgabewert
(None)
Original:
(none)
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.
[Bearbeiten]Komplexität
Constant .
Original:
Constant.
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.
[Bearbeiten]Beispiel
Der folgende Code verwendet
push_back
mehrere Zahlen zu einem std::deque<int> hinzu: Original:
The following code uses
push_back
to add several integers to a std::deque<int>: 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.
#include <deque>#include <iostream> int main(){std::deque<int> numbers; numbers.push_back(42); numbers.push_back(314159); for(int i : numbers){// c++11 range-based for loopstd::cout<< i <<'\n';} return0;}
Output:
42 314159
[Bearbeiten]Siehe auch
(C++11) | baut Elemente-Platz am Ende Original: constructs elements in-place at 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) |
Elemente am Listenanfang einfügen (öffentliche Elementfunktion) | |
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) |