diff options
Diffstat (limited to 'libcxx/test/std/containers/associative/set/emplace.pass.cpp')
| -rw-r--r-- | libcxx/test/std/containers/associative/set/emplace.pass.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libcxx/test/std/containers/associative/set/emplace.pass.cpp b/libcxx/test/std/containers/associative/set/emplace.pass.cpp index e038de77d48a..e5a9f9590aad 100644 --- a/libcxx/test/std/containers/associative/set/emplace.pass.cpp +++ b/libcxx/test/std/containers/associative/set/emplace.pass.cpp @@ -15,12 +15,12 @@ // template <class... Args> // pair<iterator, bool> emplace(Args&&... args); -#include <set> #include <cassert> +#include <set> -#include "test_macros.h" #include "../../Emplaceable.h" #include "DefaultOnly.h" +#include "MoveOnly.h" #include "min_allocator.h" int main(int, char**) { @@ -84,6 +84,13 @@ int main(int, char**) { assert(m.size() == 1); assert(*r.first == 2); } + { // We're unwrapping pairs for `{,multi}map`. Make sure we're not trying to do that for set. + using Set = std::set<std::pair<MoveOnly, MoveOnly>>; + Set set; + auto res = set.emplace(std::pair<MoveOnly, MoveOnly>(2, 4)); + assert(std::get<1>(res)); + assert(set.begin() == std::get<0>(res)); + } return 0; } |
