Espacios de nombres
Variantes
Acciones

std::vector::emplace

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

 
 
 
std::vector
Las funciones miembro
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.
Elemento acceso
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.
Los iteradores
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Capacidad
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Modificadores
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::emplace
(C++11)
 
template< class... Args >
iterator emplace( const_iterator pos, Args&&... args );
(desde C++11)
Inserta un nuevo elemento en el contenedor directamente ante pos. El elemento se construye en el lugar, es decir, no copiar o mover las operaciones se realizan. El constructor del elemento se llama con el std::forward<Args>(args)... argumentos. El tipo de elemento debe ser EmplaceConstructible, MoveInsertable and MoveAssignable .
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.

Contenido

[editar] Parámetros

pos -
iterador antes de que el nuevo elemento será construido
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 -
argumentos que transmitan al constructor del elemento
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.

[editar] Valor de retorno

Iterador que señala al elemento emplazados .
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.

[editar] Complejidad

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

[editar] Excepciones

Si se produce una excepción (por ejemplo, por el constructor), el recipiente se deja sin modificaciones, como si esta función nunca fue llamado (garantía excepción fuerte) .
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.

[editar] Ver también

Inserta elementos
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.

(función miembro público) [editar]