std::deque
De cppreference.com
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
Déclaré dans l'en-tête <deque>
|
||
template< class T, |
||
std::deque
(Queue à double entrées) est un conteneur de séquence indexées qui permet une insertion et suppression rapide à ses extrémités. De plus, l'insertion et la suppression à chaque extrémité d'un deque n'invalidera jamais les pointeurs ou références aux autres éléments .Original:
std::deque
(double-ended queue) is an indexed sequence container that allows fast insertion and deletion at both the beginning and the end. In addition, insertion and deletion at either end of a deque never invalidates pointers or references to the rest of the elements.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.
Par opposition à std::vector, les éléments d'une file double ne sont pas stockés de façon contiguë: implémentations typiques utiliser une séquence de individuellement allouées tableaux de taille fixe .
Original:
As opposed to std::vector, the elements of a deque are not stored contiguously: typical implementations use a sequence of individually allocated fixed-size arrays.
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.
Le stockage du deque est automatiquement dilaté et contracté selon les besoins. Agrandissement d'une file est moins cher que l'expansion d'une std::vector car il ne s'agit pas de copier des éléments existants à un nouvel emplacement mémoire .
Original:
The storage of the deque is automatically expanded and contracted as needed. Expansion of a deque is cheaper than the expansion of a std::vector because it does not involve copying of the existing elements to a new memory location.
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.
La complexité (efficacité) des opérations communes sur deques est la suivante:
Original:
The complexity (efficiency) of common operations on deques 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.
You can help to correct and verify the translation. Click here for instructions.
- Accès aléatoire - O(1) constanteOriginal: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. - Insertion ou le retrait d'éléments à la fin ou au début - O(1) amorti constantOriginal:Insertion or removal of elements at the end or beginning - 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. - Insertion ou le retrait d'éléments - O(n) linéaireOriginal:Insertion or removal of elements - linear 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::deque
répond aux exigences de Container
, AllocatorAwareContainer
, SequenceContainer
et ReversibleContainer
.Original:
std::deque
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.
You can help to correct and verify the translation. Click here for instructions.
[modifier] Types de membres
Type du membre | Définition |
value_type
|
T
|
allocator_type
|
Allocator
|
size_type
|
Type intégral non signé (généralement size_t) |
difference_type
|
Type intégral signé (généralement ptrdiff_t) |
reference
|
Allocator::reference (avant C++11)value_type& (depuis C++11)
|
const_reference
|
Allocator::const_reference (avant C++11)const value_type& (depuis C++11)
|
pointer
|
Allocator::pointer (avant C++11)std::allocator_traits<Allocator>::pointer (depuis C++11) |
const_pointer
|
Allocator::const_pointer (avant C++11) std::allocator_traits<Allocator>::const_pointer (depuis C++11) |
iterator
|
RandomAccessIterator
|
const_iterator
|
Itérateur constant à accès aléatoire |
reverse_iterator
|
std::reverse_iterator<iterator> |
const_reverse_iterator
|
std::reverse_iterator<const_iterator> |
[modifier] Fonctions membres
Construit le deque (fonction membre publique) | |
détruit le deque (fonction membre publique) | |
Attribue les valeurs dans le conteneur (fonction membre publique) | |
Attribue les valeurs dans le conteneur | |
Renvoie l'allocateur associé | |
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. | |
accède à l'élément spécifié avec vérification de bornes (fonction membre publique) | |
accède à l'élément spécifié (fonction membre publique) | |
accède au premier élément (fonction membre publique) | |
accède au dernier élément (fonction membre publique) | |
Original: Iterators The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
retourne un itérateur au début 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. (fonction membre publique) | |
retourne un itérateur à la fin 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. (fonction membre publique) | |
retourne un itérateur inversé au début (fonction membre publique) | |
retourne un itérateur inversé à la fin (fonction membre publique) | |
Original: Capacity The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
vérifie si le conteneur est vide 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. (fonction membre publique) | |
retourne le nombre d'éléments 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. (fonction membre publique) | |
retourne le plus grand nombre possible d'éléments 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. (fonction membre publique) | |
(C++11) |
réduit l'utilisation de la mémoire en libérant la mémoire inutilisée 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. (fonction membre publique) |
Original: Modifiers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
efface le contenu 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. (fonction membre publique) | |
insère des éléments 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. (fonction membre publique) | |
(C++11) |
construit des éléments en mémoire (fonction membre publique) |
efface des éléments (fonction membre publique) | |
ajoute des éléments à la fin 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. (fonction membre publique) | |
(C++11) |
construit des éléments en place à la fin (fonction membre publique) |
supprime le dernier élément 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. (fonction membre publique) | |
insère des éléments au début (fonction membre publique) | |
(C++11) |
construit des éléments en place au début (fonction membre publique) |
supprime le premier élément Original: removes 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. (fonction membre publique) | |
modifie le nombre d'éléments stockés Original: changes the number of elements stored The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction membre publique) | |
permute les contenus 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. (fonction membre publique) |
[modifier] Fonctions annexes
compare lexicographiquement les valeurs dans le deque Original: lexicographically compares the values in the deque The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction générique) | |
l'algorithme spécialisé 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. (fonction générique) |