Namensräume
Varianten
Aktionen

std::vector::emplace

Aus cppreference.com
< cpp‎ | container‎ | vector

 
 
 
std::vector
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.
vector::vector
vector::~vector
vector::operator=
vector::assign
vector::get_allocator
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.
vector::at
vector::operator[]
vector::front
vector::back
vector::data(C++11)
Iteratoren
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
vector::begin
vector::cbegin

(C++11)
vector::end
vector::cend

(C++11)
vector::rbegin
vector::crbegin

(C++11)
vector::rend
vector::crend

(C++11)
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.
vector::empty
vector::size
vector::max_size
vector::reserve
vector::capacity
vector::shrink_to_fit(C++11)
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.
vector::clear
vector::insert
vector::emplace(C++11)
vector::erase
vector::push_back
vector::emplace_back(C++11)
vector::pop_back
vector::resize
vector::swap
 
template< class... Args >
iterator emplace( const_iterator pos, Args&&... args );
(seit C++11)
Fügt ein neues Element in den Behälter direkt vor pos. Das Element in-place ist so aufgebaut, dh kein Kopieren oder Verschieben von Operationen durchgeführt werden. Der Konstruktor des Elements mit den Argumenten std::forward<Args>(args)... genannt. Der Elementtyp muss EmplaceConstructible, MoveInsertable and MoveAssignable sein .
Original:
Inserts a new element into the container directly before pos. The element is constructed in-place, i.e. no copy or move operations are performed. The constructor of the element is called with the arguments std::forward<Args>(args).... The element type must be EmplaceConstructible, MoveInsertable and MoveAssignable.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

If the new size() is greater than capacity(), all iterators and references are invalidated. Otherwise, only the iterators and references after the added element are invalidated.

Inhaltsverzeichnis

[Bearbeiten] Parameter

pos -
Iterator vor dem das neue Element gebaut werden
Original:
iterator before which the new element will be constructed
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
args -
Argumente, die an den Konstruktor des Elements weiterzuleiten
Original:
arguments to forward to the constructor of the element
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

Iterator zeigt auf der eingelagerten Element .
Original:
Iterator pointing to the emplaced element.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Komplexität

Linear in the distance between pos and end of the container.

[Bearbeiten] Ausnahmen

Wenn eine Ausnahme ausgelöst wird (z. B. durch den Konstruktor), wird der Behälter links unverändert, als ob diese Funktion nie aufgerufen wurde (starke Ausnahme Garantie) .
Original:
If an exception is thrown (e.g. by the constructor), the container is left unmodified, as if this function was never called (strong exception guarantee).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Siehe auch

Elemente einfügen
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) [edit]