1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // <vector>
10 // vector<bool>
11 
12 // size_type capacity() const;
13 
14 #include <vector>
15 #include <cassert>
16 
17 #include "min_allocator.h"
18 
19 int main(int, char**)
20 {
21     {
22         std::vector<bool> v;
23         assert(v.capacity() == 0);
24     }
25     {
26         std::vector<bool> v(100);
27         assert(v.capacity() >= 100);
28         v.push_back(0);
29         assert(v.capacity() >= 101);
30     }
31 #if TEST_STD_VER >= 11
32     {
33         std::vector<bool, min_allocator<bool>> v;
34         assert(v.capacity() == 0);
35     }
36     {
37         std::vector<bool, min_allocator<bool>> v(100);
38         assert(v.capacity() >= 100);
39         v.push_back(0);
40         assert(v.capacity() >= 101);
41     }
42 #endif
43 
44   return 0;
45 }
46