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// UNSUPPORTED: c++98, c++03
11
12// <list>
13
14// iterator insert(const_iterator position, value_type&& x);
15
16#include <list>
17#include <cassert>
18
19#include "MoveOnly.h"
20#include "min_allocator.h"
21
22int main()
23{
24    {
25    std::list<MoveOnly> l1;
26    l1.insert(l1.cend(), MoveOnly(1));
27    assert(l1.size() == 1);
28    assert(l1.front() == MoveOnly(1));
29    l1.insert(l1.cbegin(), MoveOnly(2));
30    assert(l1.size() == 2);
31    assert(l1.front() == MoveOnly(2));
32    assert(l1.back() == MoveOnly(1));
33    }
34    {
35    std::list<MoveOnly, min_allocator<MoveOnly>> l1;
36    l1.insert(l1.cend(), MoveOnly(1));
37    assert(l1.size() == 1);
38    assert(l1.front() == MoveOnly(1));
39    l1.insert(l1.cbegin(), MoveOnly(2));
40    assert(l1.size() == 2);
41    assert(l1.front() == MoveOnly(2));
42    assert(l1.back() == MoveOnly(1));
43    }
44}
45