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 // vector(size_type n, const value_type& x);
     14 
     15 #include <vector>
     16 #include <cassert>
     17 
     18 #include "test_macros.h"
     19 #include "min_allocator.h"
     20 
     21 template <class C>
     22 void
     23 test(typename C::size_type n, const typename C::value_type& x)
     24 {
     25     C c(n, x);
     26     LIBCPP_ASSERT(c.__invariants());
     27     assert(c.size() == n);
     28     for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i)
     29         assert(*i == x);
     30 }
     31 
     32 int main()
     33 {
     34     test<std::vector<bool> >(50, true);
     35 #if TEST_STD_VER >= 11
     36     test<std::vector<bool, min_allocator<bool>> >(50, true);
     37 #endif
     38 }
     39