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 // iterator insert(const_iterator position, const value_type& x);
18 #include "test_macros.h"
19 #include "min_allocator.h"
20 #include "count_new.hpp"
26 int a2[] = {1, 4, 2, 3};
28 typename List::iterator i = l1.insert(next(l1.cbegin()), 4);
29 assert(i == next(l1.begin()));
30 assert(l1.size() == 4);
31 assert(distance(l1.begin(), l1.end()) == 4);
32 assert(l1 == List(a2, a2+4));
34 #if !defined(TEST_HAS_NO_EXCEPTIONS) && !defined(DISABLE_NEW_COUNT)
35 globalMemCounter.throw_after = 0;
36 int save_count = globalMemCounter.outstanding_new;
45 assert(globalMemCounter.checkOutstandingNewEq(save_count));
46 assert(l1 == List(a2, a2+4));
52 test<std::list<int> >();
53 #if TEST_STD_VER >= 11
54 test<std::list<int, min_allocator<int>>>();