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 20 template <class C> 21 void 22 test0() 23 { 24 C c; 25 assert(c.__invariants()); 26 assert(c.empty()); 27 assert(c.get_allocator() == typename C::allocator_type()); 28 } 29 30 template <class C> 31 void 32 test1(const typename C::allocator_type& a) 33 { 34 C c(a); 35 assert(c.__invariants()); 36 assert(c.empty()); 37 assert(c.get_allocator() == a); 38 } 39 40 int main() 41 { 42 { 43 test0<std::vector<bool> >(); 44 test1<std::vector<bool, test_allocator<bool> > >(test_allocator<bool>(3)); 45 } 46 } 47