Home | History | Annotate | Download | only in vector.bool
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // <vector>
     11 // vector<bool>
     12 
     13 // explicit vector(size_type n);
     14 
     15 #include <vector>
     16 #include <cassert>
     17 
     18 template <class C>
     19 void
     20 test(typename C::size_type n)
     21 {
     22     C c(n);
     23     assert(c.__invariants());
     24     assert(c.size() == n);
     25     assert(c.get_allocator() == typename C::allocator_type());
     26     for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i)
     27         assert(*i == typename C::value_type());
     28 }
     29 
     30 int main()
     31 {
     32     test<std::vector<bool> >(50);
     33 }
     34