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 #include <unordered_set>
24 #include "test_allocator.h"
30 some_comp& operator=(const some_comp&);
38 some_hash(const some_hash&);
39 some_hash& operator=(const some_hash&);
44 #if __has_feature(cxx_noexcept)
46 typedef std::unordered_set<MoveOnly> C;
47 static_assert(std::is_nothrow_move_assignable<C>::value, "");
50 typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
51 std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
52 static_assert(!std::is_nothrow_move_assignable<C>::value, "");
55 typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
56 std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
57 static_assert(std::is_nothrow_move_assignable<C>::value, "");
60 typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>> C;
61 static_assert(!std::is_nothrow_move_assignable<C>::value, "");
64 typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
65 some_comp<MoveOnly>> C;
66 static_assert(!std::is_nothrow_move_assignable<C>::value, "");