◐ Shell
clean mode source ↗

std::list — cppreference.com

De cppreference.com

<tbody> </tbody>

Déclaré dans l'en-tête

<list>

template< class T, class Allocator = std::allocator<T> > class list;

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.

Types de membres

Type du membre Définition
value_type T [edit]
allocator_type Allocator [edit]
size_type Type intégral non signé (généralement size_t)[edit]
difference_type Type intégral signé (généralement ptrdiff_t) [edit]
reference Allocator::reference (avant C++11)
value_type& (depuis C++11) [edit]
const_reference Allocator::const_reference (avant C++11)
const value_type& (depuis C++11) [edit]
pointer Allocator::pointer (avant C++11)
std::allocator_traits<Allocator>::pointer (depuis C++11) [edit]
const_pointer Allocator::const_pointer (avant C++11)
std::allocator_traits<Allocator>::const_pointer (depuis C++11) [edit]
iterator BidirectionalIterator [edit]
const_iterator Itérateur constant bidirectionnel[edit]
reverse_iterator std::reverse_iterator<iterator> [edit]
const_reverse_iterator std::reverse_iterator<const_iterator> [edit]

Fonctions membres

Construit le list
(fonction membre publique) [edit]
détruit le list
(fonction membre publique) [edit]
Attribue les valeurs dans le conteneur
(fonction membre publique) [edit]

Attribue les valeurs dans le conteneur
(fonction membre publique) [edit]

Renvoie l'allocateur associé
(fonction membre publique) [edit]

Elément d'accès

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) [edit]
accède au dernier élément
(fonction membre publique) [edit]

Les itérateurs

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) [edit]

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) [edit]
retourne un itérateur inversé au début
(fonction membre publique) [edit]
retourne un itérateur inversé à la fin
(fonction membre publique) [edit]

Capacité

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) [edit]

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) [edit]

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) [edit]

Modificateurs

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) [edit]

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) [edit]

(C++11)

construit des éléments en mémoire
(fonction membre publique) [edit]
efface des éléments
(fonction membre publique) [edit]

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) [edit]
construit des éléments en place à la fin
(fonction membre publique) [edit]

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) [edit]
insère des éléments au début
(fonction membre publique) [edit]
construit des éléments en place au début
(fonction membre publique) [edit]

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) [edit]

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) [edit]

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) [edit]

Opérations

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) [edit]

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) [edit]

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) [edit]

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) [edit]

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) [edit]

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) [edit]

Fonctions annexes