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 // iterator insert(const_iterator position, const value_type& x); 14 15 #include <vector> 16 #include <cassert> 17 18 int main() 19 { 20 { 21 std::vector<bool> v(100); 22 std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, 1); 23 assert(v.size() == 101); 24 assert(i == v.begin() + 10); 25 int j; 26 for (j = 0; j < 10; ++j) 27 assert(v[j] == 0); 28 assert(v[j] == 1); 29 for (++j; j < 101; ++j) 30 assert(v[j] == 0); 31 } 32 } 33