Espacios de nombres
Variantes
Acciones

std::vector

De cppreference.com
< cpp‎ | container


 
 
 
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.
vector::vector
vector::~vector
vector::operator=
vector::assign
vector::get_allocator
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.
vector::at
vector::operator[]
vector::front
vector::back
vector::data(C++11)
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.
vector::begin
vector::cbegin

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

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

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

(C++11)
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.
vector::empty
vector::size
vector::max_size
vector::reserve
vector::capacity
vector::shrink_to_fit(C++11)
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::clear
vector::insert
vector::emplace(C++11)
vector::erase
vector::push_back
vector::emplace_back(C++11)
vector::pop_back
vector::resize
vector::swap
 
Defined in header <vector>
template<

    class T,
    class Allocator = std::allocator<T>

> class vector;
std::vector es un contenedor que encapsula secuencia de matrices dinámicas tamaño .
Original:
std::vector is a sequence container that encapsulates dynamic size arrays.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Los elementos se almacenan de forma contigua, lo que significa que los elementos no se puede acceder sólo a través de los iteradores, pero también con los desplazamientos en punteros regulares a los elementos. Esto significa que un puntero a un elemento de un vector se puede hacer pasar a cualquier función que espera un puntero a un elemento de una matriz .
Original:
The elements are stored contiguously, which means that elements can be accessed not only through iterators, but also using offsets on regular pointers to elements. This means that a pointer to an element of a vector may be passed to any function that expects a pointer to an element of an array.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
El almacenamiento del vector se maneja automáticamente, siendo expandido y contraído, según sea necesario. Vectores suelen ocupar más espacio que las matrices estáticas, ya que se asigna más memoria para manejar el crecimiento futuro. De esta manera un vector no necesita reasignar cada vez que se inserta un elemento, pero sólo cuando la memoria adicional se agota. La cantidad total de memoria asignada puede ser consultada mediante la función capacity(). Memoria adicional se puede devolver al sistema a través de una llamada a shrink_to_fit() .
Original:
The storage of the vector is handled automatically, being expanded and contracted as needed. Vectors usually occupy more space than static arrays, because more memory is allocated to handle future growth. This way a vector does not need to reallocate each time an element is inserted, but only when the additional memory is exhausted. The total amount of allocated memory can be queried using capacity() function. Extra memory can be returned to the system via a call to shrink_to_fit().
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Las reasignaciones suelen ser operaciones costosas en términos de rendimiento. reserve() función puede ser utilizada para eliminar las reasignaciones si el número de elementos que se conoce de antemano .
Original:
Reallocations are usually costly operations in terms of performance. reserve() function can be used to eliminate reallocations if the number of elements is known beforehand.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
La complejidad (eficacia) de las operaciones comunes de vectores es el siguiente:
Original:
The complexity (efficiency) of common operations on vectors is as follows:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • Acceso aleatorio - O(1) constante
    Original:
    Random access - constant O(1)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • Inserción o extracción de elementos al final - O(1) constante amortizado
    Original:
    Insertion or removal of elements at the end - amortized constant O(1)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • La inserción o la eliminación de los elementos - lineal en distancia hasta el extremo de la O(n) vector
    Original:
    Insertion or removal of elements - linear in distance to the end of the vector O(n)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
std::vector cumple los requisitos de Container, AllocatorAwareContainer, SequenceContainer y ReversibleContainer .
Original:
std::vector meets the requirements of Container, AllocatorAwareContainer, SequenceContainer and ReversibleContainer.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Contenido

[editar] Especializaciones

La biblioteca estándar proporciona una especialización de std::vector para la bool tipo, que está optimizado para la eficiencia del espacio .
Original:
The standard library provides a specialization of std::vector for the type bool, which is optimized for space efficiency.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
eficiente con el espacio bitset dinámico
Original:
space-efficient dynamic bitset
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(clase de plantilla) [edit]

[editar] Tipos de miembros

Miembro de tipo
Original:
Member type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
value_type T [edit]
allocator_type Allocator [edit]
size_type
Tipo entero sin signo (por lo general size_t)
Original:
Unsigned integral type (usually size_t)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[edit]
difference_type Signed integer type (usually ptrdiff_t) [edit]
reference Allocator::reference (hasta C++11)
value_type& (desde C++11) [edit]
const_reference Allocator::const_reference (hasta C++11)
const value_type& (desde C++11) [edit]
pointer Allocator::pointer (hasta C++11)
std::allocator_traits<Allocator>::pointer (desde C++11) [edit]
const_pointer Allocator::const_pointer (hasta C++11)
std::allocator_traits<Allocator>::const_pointer (desde C++11) [edit]
iterator RandomAccessIterator [edit]
const_iterator
Iterador constante de acceso aleatorio
Original:
Constant random access iterator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[edit]
reverse_iterator std::reverse_iterator<iterator> [edit]
const_reverse_iterator std::reverse_iterator<const_iterator> [edit]

[editar] Las funciones miembro

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

(miembro público función) [edit]
destructs the vector
(miembro público función) [edit]
asigna valores para el contenedor
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.

(miembro público función) [edit]
asigna valores para el contenedor
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.

(miembro público función) [edit]
devuelve el asignador asociado
Original:
returns the associated allocator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público función) [edit]
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.
acceder al elemento especificado con comprobación de límites
Original:
access specified element with bounds checking
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público función) [edit]
acceder al elemento especificado
Original:
access specified element
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público función) [edit]
acceso al primer elemento
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.

(miembro público función) [edit]
access the last element
(miembro público función) [edit]
(C++11)
dirigir el acceso a la matriz subyacente
Original:
direct access to the underlying array
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público función) [edit]
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.
devuelve un iterador al principio
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.

(miembro público función) [edit]
devuelve un iterador hasta el final
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.

(miembro público función) [edit]
devuelve un iterador inverso al principio
Original:
returns a reverse 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.

(miembro público función) [edit]
devuelve un iterador inverso hasta el final
Original:
returns a reverse 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.

(miembro público función) [edit]
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.
comprueba si el recipiente está vacía
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.

(miembro público función) [edit]
devuelve el número de elementos
Original:
returns the 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.

(miembro público función) [edit]
devuelve el número máximo posible de elementos
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.

(miembro público función) [edit]
reservas de almacenamiento
Original:
reserves storage
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público función) [edit]
devuelve el número de elementos que se pueden almacenar en el almacenamiento asignado actualmente
Original:
returns the number of elements that can be held in currently allocated storage
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público función) [edit]
reduce el uso de memoria por la liberación de memoria no utilizada
Original:
reduces memory usage by freeing unused memory
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público función) [edit]
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.
borra el contenido
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.

(miembro público función) [edit]
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.

(miembro público función) [edit]
(C++11)
constructs element in-place
(miembro público función) [edit]
borra elementos
Original:
erases elements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público función) [edit]
agrega elementos al final
Original:
adds elements 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.

(miembro público función) [edit]
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.

(miembro público función) [edit]
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.

(miembro público función) [edit]
changes the number of elements stored
(miembro público función) [edit]
intercambia los contenidos
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.

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

[editar] Terceros funciones

lexicográficamente compara los valores de la vector
Original:
lexicographically compares the values in the vector
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función de plantilla) [edit]
el algoritmo se especializa std::swap
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.

(función de plantilla) [edit]