1 // { dg-do run { target c++11 } }
4 #include <testsuite_hooks.h>
10 std::deque
<int>::iterator pos
;
13 pos
= c
.emplace(c
.begin());
14 VERIFY( c
.size() == 1 );
16 VERIFY( pos
== c
.begin() );
17 pos
= c
.emplace(c
.begin(), 2);
18 VERIFY( c
.size() == 2 );
21 VERIFY( pos
== c
.begin() );
22 pos
= c
.emplace(c
.end(), 3);
23 VERIFY( c
.size() == 3 );
27 VERIFY( pos
== --c
.end() );
30 pos
= c
.emplace(c
.cbegin());
31 VERIFY( c
.size() == 4 );
34 VERIFY( pos
== c
.cbegin() );
35 pos
= c
.emplace(c
.cbegin() + 2, 22);
36 VERIFY( c
.size() == 5 );
40 VERIFY( pos
== c
.cbegin() + 2 );
45 explicit V(int a
, int b
= 0) : val(a
+b
) { }
53 std::deque
<V
>::iterator pos
;
55 pos
= c
.emplace(c
.end(), 1);
56 VERIFY( c
.size() == 1 );
57 VERIFY( c
[0].val
== 1 );
58 VERIFY( pos
== --c
.end() );
59 pos
= c
.emplace(c
.cend(), 2, 3);
60 VERIFY( c
.size() == 2 );
61 VERIFY( c
[0].val
== 1 );
62 VERIFY( c
[1].val
== 5 );
63 VERIFY( pos
== --c
.cend() );