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