std::vector<bool>
[] |
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. |
<metanoindex/>
<tbody> </tbody>| Dclar dans l'en-tte <vector>
|
||
template<class Allocator = std::allocator<bool>> class vector<bool, Allocator>; |
||
std::vector<bool> est une spcialisation plus efficace en espace de std::vector pour le type bool.
La manire dont std::vector<bool> est rendu efficace en espace (ainsi que le fait qu'elle est optimise ou pas) dpend de l'implmentation. Une optimisation potentielle consiste fusionner des lments du vecteur de sorte que chaque bit n'occupe qu'un seul bit rel 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 ncessairement ses donnes dans un seul bloc contigu de mmoire.
- Expose
std::vector<bool>::referencecomme mthode d'accs des bits individuels. - N'utilise pas
std::allocator_traits::constructpour construire des bits.
Types de membres
| Type du membre | Dfinition |
value_type
|
bool
|
allocator_type
|
Allocator
|
size_type
|
Dfini par l'implmentation |
difference_type
|
Dfini par l'implmentation |
classe proxy qui reprsente une rfrence 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
|
pointer
|
dfini par l'implmentation
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. |
const_pointer
|
dfini par l'implmentation
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. |
iterator
|
dfini par l'implmentation
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. |
const_iterator
|
Dfini par l'implmentation |
reverse_iterator
|
std::reverse_iterator<iterator>
|
const_reverse_iterator
|
std::reverse_iterator<const_iterator>
|
Fonctions membres
Construit le vector (fonction membre publique de std::vector)
| |
dtruit le vector (fonction membre publique de std::vector)
| |
| Attribue les valeurs dans le conteneur (fonction membre publique de std::vector)
| |
|
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. | |
| accde l'lment spcifi avec vrification de bornes (fonction membre publique de std::vector)
| |
| accde l'lment spcifi (fonction membre publique de std::vector)
| |
| accde au premier lment (fonction membre publique de std::vector)
| |
| accde au dernier lment (fonction membre publique de std::vector)
| |
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 itrateur au dbut 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)
| |
retourne un itrateur 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)
| |
| retourne un itrateur invers au dbut (fonction membre publique de std::vector)
| |
| retourne un itrateur invers la fin (fonction membre publique de std::vector)
| |
Original: Capacity The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
vrifie 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)
| |
retourne le nombre d'lments 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)
| |
retourne le plus grand nombre possible d'lments 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)
| |
| rserve de l'espace mmoire (fonction membre publique de std::vector)
| |
| renvoie le nombre d'lments qui peuvent tre contenus dans l'espace mmoire actuellement allou (fonction membre publique de std::vector)
| |
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)
| |
insre des lments 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)
| |
| efface des lments (fonction membre publique de std::vector)
| |
ajoute des lments 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)
| |
supprime le dernier lment 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)
| |
modifie le nombre d'lments stocks 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)
| |
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)
| |
vector<bool> modificateurs spcifiquesOriginal: vector<bool> specific modifiersThe 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) | |
[ 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>::referencesOriginal: swaps two std::vector<bool>::referencesThe 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) |
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 gnrique) | |
l'algorithme spcialis 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 gnrique) | |
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>.