1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // template <InputIterator Iter>
13 // iterator insert(const_iterator position, Iter first, Iter last);
19 #include "test_macros.h"
20 #include "test_iterators.h"
21 #include "min_allocator.h"
22 #include "count_new.hpp"
28 typename List::iterator i = l1.insert(l1.begin(), a1, a1+3);
29 assert(i == l1.begin());
30 assert(l1.size() == 3);
31 assert(distance(l1.begin(), l1.end()) == 3);
39 i = l1.insert(i, a2, a2+3);
41 assert(l1.size() == 6);
42 assert(distance(l1.begin(), l1.end()) == 6);
56 #if !defined(TEST_HAS_NO_EXCEPTIONS) && !defined(DISABLE_NEW_COUNT)
57 globalMemCounter.throw_after = 2;
58 int save_count = globalMemCounter.outstanding_new;
61 i = l1.insert(i, a2, a2+3);
67 assert(globalMemCounter.checkOutstandingNewEq(save_count));
68 assert(l1.size() == 6);
69 assert(distance(l1.begin(), l1.end()) == 6);
87 test<std::list<int> >();
88 #if TEST_STD_VER >= 11
89 test<std::list<int, min_allocator<int>>>();