[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / libcxx / test / std / containers / unord / unord.multiset / emplace_hint.pass.cpp
blobea7886b9cbda203e6d40968d447aeda684df5dca
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++98, 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_hint(const_iterator p, Args&&... args);
21 #include <unordered_set>
22 #include <cassert>
24 #include "test_macros.h"
25 #include "../../Emplaceable.h"
26 #include "min_allocator.h"
28 int main(int, char**)
31 typedef std::unordered_multiset<Emplaceable> C;
32 typedef C::iterator R;
33 C c;
34 C::const_iterator e = c.end();
35 R r = c.emplace_hint(e);
36 assert(c.size() == 1);
37 assert(*r == Emplaceable());
39 r = c.emplace_hint(c.end(), Emplaceable(5, 6));
40 assert(c.size() == 2);
41 assert(*r == Emplaceable(5, 6));
43 r = c.emplace_hint(r, 5, 6);
44 assert(c.size() == 3);
45 assert(*r == Emplaceable(5, 6));
48 typedef std::unordered_multiset<Emplaceable, std::hash<Emplaceable>,
49 std::equal_to<Emplaceable>, min_allocator<Emplaceable>> C;
50 typedef C::iterator R;
51 C c;
52 C::const_iterator e = c.end();
53 R r = c.emplace_hint(e);
54 assert(c.size() == 1);
55 assert(*r == Emplaceable());
57 r = c.emplace_hint(c.end(), Emplaceable(5, 6));
58 assert(c.size() == 2);
59 assert(*r == Emplaceable(5, 6));
61 r = c.emplace_hint(r, 5, 6);
62 assert(c.size() == 3);
63 assert(*r == Emplaceable(5, 6));
66 return 0;