• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // void resize(size_type sz);
14 
15 #include <vector>
16 #include <cassert>
17 
18 #include "min_allocator.h"
19 
main()20 int main()
21 {
22     {
23         std::vector<bool> v(100);
24         v.resize(50);
25         assert(v.size() == 50);
26         assert(v.capacity() >= 100);
27         v.resize(200);
28         assert(v.size() == 200);
29         assert(v.capacity() >= 200);
30     }
31 #if __cplusplus >= 201103L
32     {
33         std::vector<bool, min_allocator<bool>> v(100);
34         v.resize(50);
35         assert(v.size() == 50);
36         assert(v.capacity() >= 100);
37         v.resize(200);
38         assert(v.size() == 200);
39         assert(v.capacity() >= 200);
40     }
41 #endif
42 }
43