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(const Alloc& = Alloc());
14 
15 #include <vector>
16 #include <cassert>
17 
18 #include "../../test_allocator.h"
19 #include "../../min_allocator.h"
20 
21 template <class C>
22 void
23 test0()
24 {
25     C c;
26     assert(c.__invariants());
27     assert(c.empty());
28     assert(c.get_allocator() == typename C::allocator_type());
29 }
30 
31 template <class C>
32 void
33 test1(const typename C::allocator_type& a)
34 {
35     C c(a);
36     assert(c.__invariants());
37     assert(c.empty());
38     assert(c.get_allocator() == a);
39 }
40 
41 int main()
42 {
43     {
44     test0<std::vector<bool> >();
45     test1<std::vector<bool, test_allocator<bool> > >(test_allocator<bool>(3));
46     }
47 #if __cplusplus >= 201103L
48     {
49     test0<std::vector<bool, min_allocator<bool>> >();
50     test1<std::vector<bool, min_allocator<bool> > >(min_allocator<bool>());
51     }
52 #endif
53 }
54