std::vector<bool>::reference
Aus cppreference.com
< cpp | container | 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. |
template<class Allocator>class vector<bool, Allocator>{// ...public:class reference {friendclass vector; reference();public: ~reference(); operator bool()const; reference& operator=(bool x); reference& operator=(const reference&);void flip();};// ...};
The std::vector<bool> specialization defines std::vector<bool>::reference as a publicly-accessible nested class. std::vector<bool>::reference proxies the behavior of references to a single bit in std::vector<bool>.
- operator bool returns true when the bit is set.
- The assignment operators set and clear the given bit.
- flip inverts the state of the bit.
[Bearbeiten]Siehe auch
Zugriff auf angegebene Element 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. (öffentliche Elementfunktion of std::vector ) |