1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // unordered_set& operator=(unordered_set&& c)
14 // allocator_type::propagate_on_container_move_assignment::value &&
15 // is_nothrow_move_assignable<allocator_type>::value &&
16 // is_nothrow_move_assignable<key_compare>::value);
18 // This tests a conforming extension
20 // UNSUPPORTED: c++98, c++03
22 #include <unordered_set>
25 #include "test_macros.h"
27 #include "test_allocator.h"
33 some_comp& operator=(const some_comp&);
34 bool operator()(const T&, const T&) const { return false; }
42 some_hash(const some_hash&);
43 some_hash& operator=(const some_hash&);
49 typedef std::unordered_set<MoveOnly> C;
50 static_assert(std::is_nothrow_move_assignable<C>::value, "");
53 typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
54 std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
55 static_assert(!std::is_nothrow_move_assignable<C>::value, "");
58 typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
59 std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
60 LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
63 typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>> C;
64 static_assert(!std::is_nothrow_move_assignable<C>::value, "");
67 typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
68 some_comp<MoveOnly>> C;
69 static_assert(!std::is_nothrow_move_assignable<C>::value, "");