Conceptos C++: SequenceContainer
De cppreference.com
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.
You can help to correct and verify the translation. Click here for instructions.
Requisitos
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 tipoOriginal: Objects of type XThe 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álidoOriginal: InputIterators denoting a valid rangeThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
il
|
std::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. |
| expression | return type | effects | precondition | postcondition |
|---|---|---|---|---|
X(n,t) |
Constructs a SequenceContainer containing n copies of t |
T CopyInsertable |
std::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 = il |
X& |
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) |
iterator | Inserts n copies of t before i
|
T CopyInsertable and CopyAssignable
|
|
a.insert(p,i,j) |
iterator | Inserts copies of elements in [i, j) before p
|
|
Each iterator in [i,j) is dereferenced once
|
a.insert(p, il) |
iterator | a.insert(p,il.begin(),il.end()) |
||
a.erase(q) |
iterator | Erases the element pointed to by q | (std :: deque, std :: vector) T MoveAssignable
|
|
a.erase(p,q) |
iterator | Erases elements in [p,q) |
(std :: deque, std :: vector) T MoveAssignable |
|
a.clear() |
void | Destroys all elements in a |
| |
a.assign(i,j) |
void | Replaces elements in a with a copy of [i, j)
|
|
Each iterator in [i,j) is dereferenced once
|
a.assign(il) |
void | a.assign(il.begin(),il.end()) |
||
a.assign(n,t) |
void | Replaces elements in a with n copies of t
|
T CopyInsertable and CopyAssignable
|
Operaciones opcionales
| Esta sección está incompleta |
SequenceContainers en la biblioteca estándar
(C++11) |
Array estático contiguo. (plantilla de clase) |
| Array dinámico contiguo. (plantilla de clase) | |
Cola doblemente terminada (deque). (plantilla de clase) | |
(desde C++11) |
Lista enlazada. (plantilla de clase) |
| Lista doblemente enlazada. (plantilla de clase) |
