Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/container/vector bool"

From cppreference.com
< cpp‎ | container
(tt -> cpp)
m (Text replace - "{{cpp|" to "{{c|")
Line 6: Line 6:
 
}}  
 
}}  
  
{{cpp|std::vector<bool>}} is a space-efficient specialization of {{cpp|std::vector}} for the type {{cpp|bool}}.   
+
{{c|std::vector<bool>}} is a space-efficient specialization of {{c|std::vector}} for the type {{c|bool}}.   
  
It behaves similarly to {{cpp|std::vector}}, but in order to be space efficient, {{cpp|std::vector<bool>}}:
+
It behaves similarly to {{c|std::vector}}, but in order to be space efficient, {{c|std::vector<bool>}}:
  
 
* Does not necessarily store its data in a single contiguous chunk of memory.
 
* Does not necessarily store its data in a single contiguous chunk of memory.
* Exposes {{cpp|std::vector<bool>::reference}} as a method of accessing individual bits.
+
* Exposes {{c|std::vector<bool>::reference}} as a method of accessing individual bits.
* Does not use {{cpp|std::allocator_traits::construct}} to construct bit values.
+
* Does not use {{c|std::allocator_traits::construct}} to construct bit values.
  
 
===Member types===
 
===Member types===

Revision as of 18:54, 19 April 2012

Template:cpp/container/vector bool/sidebar

Defined in header <vector>
template<class Allocator = std::allocator<bool>>
class vector<bool, Allocator>;

std::vector<bool> is a space-efficient specialization of std::vector for the type bool.

It behaves similarly to std::vector, but in order to be space efficient, std::vector<bool>:

  • Does not necessarily store its data in a single contiguous chunk of memory.
  • Exposes std::vector<bool>::reference as a method of accessing individual bits.
  • Does not use std::allocator_traits::construct to construct bit values.

Contents

Member types

Template:tdcl list begin Template:tdcl list hitem Template:tdcl list template Template:tdcl list template Template:tdcl list template Template:tdcl list template |- class="t-dsc"

|

| proxy class representing a reference to a single bool
(class) |-

Template:tdcl list template Template:tdcl list template Template:tdcl list template Template:tdcl list template Template:tdcl list template Template:tdcl list template Template:tdcl list template Template:tdcl list end

Member functions

Template:cpp/container/dcl list constructorTemplate:cpp/container/dcl list destructorTemplate:cpp/container/dcl list operator=Template:cpp/container/dcl list assignTemplate:cpp/container/dcl list get allocatorTemplate:cpp/container/dcl list atTemplate:cpp/container/dcl list operator atTemplate:cpp/container/dcl list frontTemplate:cpp/container/dcl list backTemplate:cpp/container/dcl list dataTemplate:cpp/container/dcl list beginTemplate:cpp/container/dcl list endTemplate:cpp/container/dcl list rbeginTemplate:cpp/container/dcl list rendTemplate:cpp/container/dcl list emptyTemplate:cpp/container/dcl list sizeTemplate:cpp/container/dcl list max sizeTemplate:cpp/container/dcl list reserveTemplate:cpp/container/dcl list capacityTemplate:cpp/container/dcl list shrink to fitTemplate:cpp/container/dcl list clearTemplate:cpp/container/dcl list insertTemplate:cpp/container/dcl list emplaceTemplate:cpp/container/dcl list eraseTemplate:cpp/container/dcl list push backTemplate:cpp/container/dcl list emplace backTemplate:cpp/container/dcl list pop backTemplate:cpp/container/dcl list resizeTemplate:cpp/container/dcl list swapTemplate:cpp/container/vector bool/dcl list flipTemplate:cpp/container/vector bool/dcl list swap
Element access
Iterators
Capacity
Modifiers
vector<bool> specific modifiers

Non-member functions

Template:cpp/container/dcl list operator cmpTemplate:cpp/container/dcl list swap2