Constructors

  explicit bitvector(const allocator_type& a = Allocator());
  

Constructs an empty bitvector, with the supplied (or defaulted) allocator. It will not throw an exception unless constructing or copying the allocator throws an exception. The default allocator, std::allocator<bool>, will not throw in this context.

Postcondition: size() == 0 and capacity() == 0. If an allocator was supplied then get_allocator() == a, else get_allocator() == Allocator().

  explicit bitvector(size_type n, bool x = false, const 
  allocator_type& a = Allocator());
  

Constructs a bitvector of length n with all values set to x.

Postcondition: size() == n and capacity() >= n. All elements are equal to x. If an allocator was supplied then get_allocator() == a, else get_allocator() == Allocator().

  template <class InputIterator>
  
      bitvector(InputIterator first, InputIterator last, const 
  allocator_type& a = Allocator());
  

Constructs a bitvector from the range [first, last).

Postcondition: size() == distance(first, last) and capacity() >= size(). All elements are equal to the corresponding values in the range [first, last). If an allocator was supplied then get_allocator() == a, else get_allocator() == Allocator().

  bitvector(const bitvector& x);
  

Constructs a copy of the bitvector x.

Postcondition: *this == x. get_allocator() == x.get_allocator().

Note: The capacity of x is not necessarily duplicated in *this. In general, the copy will be done with the least amount of capacity sufficient to hold size() elements.