Espaces de noms
Variantes
Affichages
Actions

std::vector<bool>

De cppreference.com
< cpp‎ | container

 
 
 
std::vector<bool>
Les fonctions membres
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
vector::vector
vector::~vector
vector::operator=
vector::assign
vector::get_allocator
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.
vector::at
vector::operator[]
vector::front
vector::back
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.
vector::begin
vector::cbegin

(C++11)
vector::end
vector::cend

(C++11)
vector::rbegin
vector::crbegin

(C++11)
vector::rend
vector::crend

(C++11)
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.
vector::empty
vector::size
vector::max_size
vector::reserve
vector::capacity
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.
vector::clear
vector::insert
vector::erase
vector::push_back
vector::pop_back
vector::resize
vector::swap
std::vector<bool> specific
vector<bool>::flip
vector<bool>::swap
 
Defined in header <vector>
template<class Allocator = std::allocator<bool>>
class vector<bool, Allocator>;

std::vector<bool> est une spécialisation plus efficace en espace de std::vector pour le type bool.

La manière dont std::vector<bool> est rendu efficace en espace (ainsi que le fait qu'elle est optimisée ou pas) dépend de l'implémentation. Une optimisation potentielle consiste à fusionner des éléments du vecteur de sorte que chaque bit n'occupe qu'un seul bit réel au lieu d'un bool de la taille d'un octet.

std::vector<bool> se comporte comme std::vector, mais pour être efficace en espace, il :

  • Ne stocke pas nécessairement ses données dans un seul bloc contigu de mémoire.
  • Expose std::vector<bool>::reference comme méthode d'accès à des bits individuels.
  • N'utilise pas std::allocator_traits::construct pour construire des bits.

Sommaire

[modifier] Types de membres

Type du membre Définition
value_type bool [edit]
allocator_type Allocator [edit]
size_type Défini par l'implémentation[edit]
difference_type Défini par l'implémentation [edit]
classe proxy qui représente une référence à un seul bool
Original:
proxy class representing a reference to a single bool
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(classe)
const_reference bool [edit]
pointer
défini par l'implémentation
Original:
implementation-defined
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[edit]
const_pointer
défini par l'implémentation
Original:
implementation-defined
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[edit]
iterator
défini par l'implémentation
Original:
implementation-defined
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[edit]
const_iterator Défini par l'implémentation[edit]
reverse_iterator std::reverse_iterator<iterator> [edit]
const_reverse_iterator std::reverse_iterator<const_iterator> [edit]

[modifier] Fonctions membres

Construit le vector
(fonction membre publique de std::vector) [edit]
Détruit le vector
Original:
destructs the vector
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 de std::vector) [edit]
Attribue les valeurs dans le conteneur
(fonction membre publique de std::vector) [edit]

Attribue les valeurs dans le conteneur
(fonction membre publique de std::vector) [edit]

Renvoie l'allocateur associé
(fonction membre publique de std::vector) [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é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 de std::vector) [edit]
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 de std::vector) [edit]
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 de std::vector) [edit]
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 de std::vector) [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 de std::vector) [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 de std::vector) [edit]
retourne un itérateur inversé au début
(fonction membre publique de std::vector) [edit]
retourne un itérateur inversé à la fin
(fonction membre publique de std::vector) [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 de std::vector) [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 de std::vector) [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 de std::vector) [edit]
réserves de stockage
Original:
reserves storage
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 de std::vector) [edit]
renvoie le nombre d'éléments qui peuvent être détenus dans les stocks actuellement affectés
Original:
returns the number of elements that can be held in currently allocated storage
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 de std::vector) [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 de std::vector) [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 de std::vector) [edit]
efface des éléments
(fonction membre publique de std::vector) [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 de std::vector) [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 de std::vector) [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 de std::vector) [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 de std::vector) [edit]
vector<bool> modificateurs spécifiques
Original:
vector<bool> specific modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
inverse tous les bits
(fonction membre publique) [edit]
[
statique
Original:
static
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
Echange deux std::vector<bool>::references
Original:
swaps two std::vector<bool>::references
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 statique) [edit]

[modifier] Fonctions annexes

compare lexicographiquement les valeurs dans le vector
Original:
lexicographically compares the values in the vector
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) [edit]
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) [edit]

[modifier] Notes

Si la taille du champ de bits est connue au moment de la compilation, std::bitset peut être utilisé, car il offre un ensemble plus riche de fonctions membres. En outre, il existe boost::dynamic_bitset comme alternative à std::vector<bool>.