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 12 // iterator insert(const_iterator p, initializer_list<value_type> il); 13 14 #include <vector> 15 #include <cassert> 16 17 int main() 18 { 19 #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS 20 std::vector<bool> d(10, true); 21 std::vector<bool>::iterator i = d.insert(d.cbegin() + 2, {false, true, true, false}); 22 assert(d.size() == 14); 23 assert(i == d.begin() + 2); 24 assert(d[0] == true); 25 assert(d[1] == true); 26 assert(d[2] == false); 27 assert(d[3] == true); 28 assert(d[4] == true); 29 assert(d[5] == false); 30 assert(d[6] == true); 31 assert(d[7] == true); 32 assert(d[8] == true); 33 assert(d[9] == true); 34 assert(d[10] == true); 35 assert(d[11] == true); 36 assert(d[12] == true); 37 assert(d[13] == true); 38 #endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS 39 } 40