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éfini dans l'entête <deque>
|
||
| template< class T, |
||
std::deque (double culot file d'attente) est un conteneur de séquence indexée qui permet une insertion rapide et la suppression à la fois le début et la fin. De plus, l'insertion et la suppression à chaque extrémité d'un deque jamais invalide pointeurs ou des références à l'ensemble des é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 de l'deque est automatiquement dilatés et contractés 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 de membre
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
|
allocator_type
|
Allocator
|
size_type
|
type intégral non signé (généralement size_t) |
difference_type
|
Signed integer type (usually ptrdiff_t) |
reference
|
Allocator::reference (jusqu'à C++11)value_type& (depuis C++11)
|
const_reference
|
Allocator::const_reference (jusqu'à C++11)const value_type& (depuis C++11)
|
pointer
|
Allocator::pointer (jusqu'à C++11)std::allocator_traits<Allocator>::pointer (depuis C++11) |
const_pointer
|
Allocator::const_pointer (jusqu'à C++11) std::allocator_traits<Allocator>::const_pointer (depuis C++11) |
iterator
|
RandomAccessIterator
|
const_iterator
|
Constant itérateur à accès aléatoire
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. |
reverse_iterator
|
std::reverse_iterator<iterator> |
const_reverse_iterator
|
std::reverse_iterator<const_iterator> |
[modifier] Les fonctions membres
| construit le deque Original: constructs 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 membre publique) | |
| Détruit le deque Original: destructs 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 membre publique) | |
| attribue des valeurs dans le récipient 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. (fonction membre publique) | |
| attribue des valeurs dans le récipient 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. (fonction membre publique) | |
| renvoie l'allocateur associé 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. (fonction membre publique) | |
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éder à l'élément spécifié avec des limites de contrôle 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. (fonction membre publique) | |
| accéder à l'élément spécifié 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. (fonction membre publique) | |
| accéder au premier élément 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. (fonction membre publique) | |
| accéder au dernier élément Original: access 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) | |
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) |
constructs element in-place (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) | |
| éléments insère au début 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. (fonction membre publique) | |
| (C++11) |
construit éléments en place au début Original: constructs elements in-place at 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) |
| 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] Tiers fonctions
| 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) | |