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(unordered_set&&)
13 // noexcept(is_nothrow_move_constructible<allocator_type>::value &&
14 // is_nothrow_move_constructible<key_compare>::value);
16 // This tests a conforming extension
18 // UNSUPPORTED: c++98, c++03
20 #include <unordered_set>
24 #include "test_allocator.h"
30 some_comp(const some_comp&);
31 bool operator()(const T&, const T&) const { return false; }
39 some_hash(const some_hash&);
45 typedef std::unordered_set<MoveOnly> C;
46 static_assert(std::is_nothrow_move_constructible<C>::value, "");
49 typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
50 std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
51 static_assert(std::is_nothrow_move_constructible<C>::value, "");
54 typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
55 std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C;
56 static_assert(std::is_nothrow_move_constructible<C>::value, "");
59 typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>> C;
60 static_assert(!std::is_nothrow_move_constructible<C>::value, "");
63 typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
64 some_comp<MoveOnly>> C;
65 static_assert(!std::is_nothrow_move_constructible<C>::value, "");