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 //===----------------------------------------------------------------------===//
11 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
12 // class Alloc = allocator<Value>>
13 // class unordered_set
15 // pair<iterator, bool> insert(const value_type& x);
17 #include <unordered_set>
20 #include "test_macros.h"
21 #include "min_allocator.h"
23 template<class Container
>
24 void do_insert_const_lvalue_test()
27 typedef std::pair
<typename
C::iterator
, bool> R
;
28 typedef typename
C::value_type VT
;
32 assert(c
.size() == 1);
33 assert(*r
.first
== 3.5);
37 assert(c
.size() == 1);
38 assert(*r
.first
== 3.5);
43 assert(c
.size() == 2);
44 assert(*r
.first
== 4.5);
49 assert(c
.size() == 3);
50 assert(*r
.first
== 5.5);
56 do_insert_const_lvalue_test
<std::unordered_set
<double> >();
57 #if TEST_STD_VER >= 11
59 typedef std::unordered_set
<double, std::hash
<double>,
60 std::equal_to
<double>, min_allocator
<double>> C
;
61 do_insert_const_lvalue_test
<C
>();