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 // template <class... Args> void emplace_back(Args&&... args); 14 15 #include <vector> 16 #include <cassert> 17 #include "min_allocator.h" 18 19 main()20int main() 21 { 22 #if _LIBCPP_STD_VER > 11 23 { 24 typedef std::vector<bool> C; 25 C c; 26 c.emplace_back(); 27 assert(c.size() == 1); 28 assert(c.front() == false); 29 c.emplace_back(true); 30 assert(c.size() == 2); 31 assert(c.front() == false); 32 assert(c.back() == true); 33 c.emplace_back(1 == 1); 34 assert(c.size() == 3); 35 assert(c.front() == false); 36 assert(c[1] == true); 37 assert(c.back() == true); 38 } 39 { 40 typedef std::vector<bool, min_allocator<bool>> C; 41 C c; 42 43 c.emplace_back(); 44 assert(c.size() == 1); 45 assert(c.front() == false); 46 c.emplace_back(true); 47 assert(c.size() == 2); 48 assert(c.front() == false); 49 assert(c.back() == true); 50 c.emplace_back(1 == 1); 51 assert(c.size() == 3); 52 assert(c.front() == false); 53 assert(c[1] == true); 54 assert(c.back() == true); 55 } 56 #endif 57 } 58