1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
13 // pair<iterator, bool> insert(const value_type& v);
18 #include "test_macros.h"
19 #include "min_allocator.h"
21 template<class Container
>
22 void do_insert_cv_test()
25 typedef std::pair
<typename
M::iterator
, bool> R
;
26 typedef typename
M::value_type VT
;
32 assert(r
.first
== m
.begin());
33 assert(m
.size() == 1);
34 assert(*r
.first
== 2);
39 assert(r
.first
== m
.begin());
40 assert(m
.size() == 2);
41 assert(*r
.first
== 1);
46 assert(r
.first
== std::prev(m
.end()));
47 assert(m
.size() == 3);
48 assert(*r
.first
== 3);
52 assert(r
.first
== std::prev(m
.end()));
53 assert(m
.size() == 3);
54 assert(*r
.first
== 3);
59 do_insert_cv_test
<std::set
<int> >();
60 #if TEST_STD_VER >= 11
62 typedef std::set
<int, std::less
<int>, min_allocator
<int>> M
;
63 do_insert_cv_test
<M
>();