[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / containers / unord / unord.multiset / emplace.pass.cpp
blob820b4cb0c97f8c18cc328120113a9b0450981ba7
1 //===----------------------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03
11 // <unordered_set>
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>
21 #include <cassert>
23 #include "test_macros.h"
24 #include "../../Emplaceable.h"
25 #include "min_allocator.h"
27 int main(int, char**)
30 typedef std::unordered_multiset<Emplaceable> C;
31 typedef C::iterator R;
32 C c;
33 R r = c.emplace();
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));
41 r = c.emplace(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;
49 C c;
50 R r = c.emplace();
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));
58 r = c.emplace(5, 6);
59 assert(c.size() == 3);
60 assert(*r == Emplaceable(5, 6));
63 return 0;