Espacios de nombres
Variantes
Acciones

Conceptos C++: SequenceContainer

De cppreference.com
< cpp‎ | concept
 
 
C + + conceptos
Básica
Original:
Basic
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Biblioteca-Wide
Original:
Library-Wide
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Container
Original:
Container
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Elementos contenedores
Original:
Container Elements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Iterator
Original:
Iterator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Números aleatorios
Original:
Random Numbers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Concurrencia
Original:
Concurrency
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
Otros
Original:
Other
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
Un SequenceContainer es un Container que almacena objetos del mismo tipo en una disposición lineal .
Original:
A SequenceContainer is a Container that stores objects of the same type in a linear arrangement.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Contenido

[editar]Requisitos

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

X
Tipo de envase
Original:
Container type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
T
Tipo de elemento
Original:
Element type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
a, b
Objetos X tipo
Original:
Objects of type X
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
t
Objeto del T tipo
Original:
Object of type T
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
n
Entero positivo
Original:
Positive integer
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
i, j
InputIterators que denotan un intervalo válido
Original:
InputIterators denoting a valid range
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ilstd::initializer_list<T>
args
Parámetro paquete
Original:
Parameter pack
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
p, q
const_iterators en a
Original:
const_iterators in a
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


expressionreturn typeeffectspreconditionpostcondition
X(n,t)Constructs a SequenceContainer containing n copies of t T CopyInsertablestd::distance(begin(),end())== n
X(i,j)Constructs a SequenceContainer equivalent to the range [i,j)std::distance(begin(),end())==

std::distance(i,j)

X(il)X(il.begin(),il.end)
a = ilX&Assigns the range represented by il into a T CopyInsertable and CopyAssignable Existing elements of a are destroyed or assigned to
a.emplace(p,args)iterator Insert an object constructed with std::forward<Args>(args) before p
a.emplace(p,t)iterator Inserts a copy of t before i
a.insert(p,n,t)iteratorInserts n copies of t before i T CopyInsertable and CopyAssignable
a.insert(p,i,j)iteratorInserts copies of elements in [i, j) before pEach iterator in [i,j) is dereferenced once
a.insert(p, il)iteratora.insert(p,il.begin(),il.end())
a.erase(q)iteratorErases the element pointed to by q (std :: deque, std :: vector) T MoveAssignable
a.erase(p,q)iteratorErases elements in [p,q)(std :: deque, std :: vector) T MoveAssignable
a.clear()voidDestroys all elements in a
  • Todas las referencias se invalidan
    Original:
    All references are invalidated
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • a.empty()==true
a.assign(i,j)voidReplaces elements in a with a copy of [i, j)Each iterator in [i,j) is dereferenced once
a.assign(il)voida.assign(il.begin(),il.end())
a.assign(n,t)void Replaces elements in a with n copies of tT CopyInsertable and CopyAssignable

[editar]Operaciones opcionales

[editar]SequenceContainers en la biblioteca estándar

(C++11)
Array estático contiguo.
(plantilla de clase)[editar]
Array dinámico contiguo.
(plantilla de clase)[editar]
Cola doblemente terminada (deque).
(plantilla de clase)[editar]
(desde C++11)
Lista enlazada.
(plantilla de clase)[editar]
Lista doblemente enlazada.
(plantilla de clase)[editar]

[editar]Trade-offs / notas de uso

std::array
Acceso rápido pero número fijo de elementos
Original:
Fast access but fixed 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.
std::vector
Acceso rápido pero sobre todo ineficiente inserciones / supresiones
Original:
Fast access but mostly inefficient insertions/deletions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::list
std::forward_list
Inserción eficiente / deleción en el medio de la secuencia
Original:
Efficient insertion/deletion in the middle of the sequence
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::deque
Inserción eficiente / deleción en el comienzo y al final de la secuencia
Original:
Efficient insertion/deletion at the beginning and at the end of the sequence
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
close