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 // void shrink_to_fit(); 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(100); 23 v.push_back(1); 24 v.shrink_to_fit(); 25 assert(v.capacity() >= 101); 26 assert(v.size() >= 101); 27 } 28 #if TEST_STD_VER >= 11 29 { 30 std::vector<bool, min_allocator<bool>> v(100); 31 v.push_back(1); 32 v.shrink_to_fit(); 33 assert(v.capacity() >= 101); 34 assert(v.size() >= 101); 35 } 36 #endif 37 38 return 0; 39 } 40