std::list
De cppreference.com
| Déclaré dans l'en-tête <list>
|
||
| template< class T, |
||
std::list est un conteneur qui permet l'insertion et la suppression rapide d'éléments depuis n'importe quel endroit du conteneur. L'accès rapide à une position aléatoire n'est pas supporté. std::list est implémenté comme une liste doublement chaînée. Par rapport à std::forward_list, ce conteneur offre la possibilité d'itérer dans les deux sens, au prix d'une occupation mémoire plus importante.
std::list répond aux exigences de Container, AllocatorAwareContainer, SequenceContainer et ReversibleContainer.
[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
|
BidirectionalIterator
|
const_iterator
|
Itérateur constant bidirectionnel |
reverse_iterator
|
std::reverse_iterator<iterator> |
const_reverse_iterator
|
std::reverse_iterator<const_iterator> |
[modifier] Fonctions membres
Construit le list (fonction membre publique) | |
détruit le list (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 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) | |
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) | |
Original: Operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| fusionne deux listes triées Original: merges two sorted lists 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éplace les éléments d'un autre list Original: moves elements from another list 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 des éléments répondant à des critères spécifiques Original: removes elements satisfying specific criteria 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) | |
| inverse l'ordre des éléments Original: reverses the order 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. (fonction membre publique) | |
| supprime les doublons successifs Original: removes consecutive duplicate 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) | |
| trie les éléments Original: sorts the 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) | |
[modifier] Fonctions annexes
| compare lexicographiquement les valeurs dans le list Original: lexicographically compares the values in the list 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) | |

