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 // UNSUPPORTED: c++98, c++03
     11 
     12 // <vector>
     13 
     14 // vector(initializer_list<value_type> il, const Allocator& a = allocator_type());
     15 
     16 #include <vector>
     17 #include <cassert>
     18 
     19 #include "test_allocator.h"
     20 #include "min_allocator.h"
     21 
     22 int main()
     23 {
     24     {
     25     std::vector<bool, test_allocator<bool>> d({true, false, false, true}, test_allocator<bool>(3));
     26     assert(d.get_allocator() == test_allocator<bool>(3));
     27     assert(d.size() == 4);
     28     assert(d[0] == true);
     29     assert(d[1] == false);
     30     assert(d[2] == false);
     31     assert(d[3] == true);
     32     }
     33     {
     34     std::vector<bool, min_allocator<bool>> d({true, false, false, true}, min_allocator<bool>());
     35     assert(d.get_allocator() == min_allocator<bool>());
     36     assert(d.size() == 4);
     37     assert(d[0] == true);
     38     assert(d[1] == false);
     39     assert(d[2] == false);
     40     assert(d[3] == true);
     41     }
     42 }
     43