]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/std/containers/sequences/vector.bool/initializer_list.pass.cpp
Vendor import of libc++ trunk r300422:
[FreeBSD/FreeBSD.git] / test / std / containers / sequences / vector.bool / initializer_list.pass.cpp
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);
15
16 #include <vector>
17 #include <cassert>
18
19 #include "min_allocator.h"
20
21 int main()
22 {
23     {
24     std::vector<bool> d = {true, false, false, true};
25     assert(d.size() == 4);
26     assert(d[0] == true);
27     assert(d[1] == false);
28     assert(d[2] == false);
29     assert(d[3] == true);
30     }
31     {
32     std::vector<bool, min_allocator<bool>> d = {true, false, false, true};
33     assert(d.size() == 4);
34     assert(d[0] == true);
35     assert(d[1] == false);
36     assert(d[2] == false);
37     assert(d[3] == true);
38     }
39 }