Espacios de nombres
Variantes
Acciones

std::deque::push_back

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

 
 
 
std :: deque
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.
deque::push_back
 
void push_back( const T& value );
void push_back( T&& value );
(desde C++11)
Anexa el elemento dado value al extremo del recipiente .
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.

All iterators are invalidated. No references are invalidated.

Contenido

[editar] Parámetros

value -
el valor del elemento a añadir
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.

[editar] Requisitos

1)
value deberá ser CopyInsertable
Original:
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.
2)
value deberá ser MoveInsertable
Original:
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.

[editar] Valor de retorno

(Ninguno)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Complejidad

Constante .
Original:
Constant.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Ejemplo

El código siguiente utiliza push_back para sumar enteros de varios a un std::deque<int>:
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.

#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 loop
        std::cout << i << '\n';
    } 
 
    return 0;
}

Salida:

42
314159

[editar] Ver también

construye elementos en lugar de al final
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.

(función miembro público) [editar]
inserciones elementos al principio
Original:
inserts elements 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.

(función miembro público) [editar]
elimina el último elemento
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.

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