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 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
14 // class Alloc = allocator<Value>>
15 // class unordered_multiset
17 // template <class... Args>
18 // iterator emplace(Args&&... args);
20 #include <unordered_set>
23 #include "test_macros.h"
24 #include "../../Emplaceable.h"
25 #include "min_allocator.h"
30 typedef std::unordered_multiset
<Emplaceable
> C
;
31 typedef C::iterator R
;
34 assert(c
.size() == 1);
35 assert(*r
== Emplaceable());
37 r
= c
.emplace(Emplaceable(5, 6));
38 assert(c
.size() == 2);
39 assert(*r
== Emplaceable(5, 6));
42 assert(c
.size() == 3);
43 assert(*r
== Emplaceable(5, 6));
46 typedef std::unordered_multiset
<Emplaceable
, std::hash
<Emplaceable
>,
47 std::equal_to
<Emplaceable
>, min_allocator
<Emplaceable
>> C
;
48 typedef C::iterator R
;
51 assert(c
.size() == 1);
52 assert(*r
== Emplaceable());
54 r
= c
.emplace(Emplaceable(5, 6));
55 assert(c
.size() == 2);
56 assert(*r
== Emplaceable(5, 6));
59 assert(c
.size() == 3);
60 assert(*r
== Emplaceable(5, 6));