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_map(unordered_map&&)
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_map>
23 #include "test_macros.h"
25 #include "test_allocator.h"
31 some_comp(const some_comp&);
32 bool operator()(const T&, const T&) const { return false; }
40 some_hash(const some_hash&);
46 typedef std::unordered_map<MoveOnly, MoveOnly> C;
47 LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
50 typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
51 std::equal_to<MoveOnly>, test_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
52 LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
55 typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
56 std::equal_to<MoveOnly>, other_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
57 LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
60 typedef std::unordered_map<MoveOnly, MoveOnly, some_hash<MoveOnly>> C;
61 static_assert(!std::is_nothrow_move_constructible<C>::value, "");
64 typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
65 some_comp<MoveOnly>> C;
66 static_assert(!std::is_nothrow_move_constructible<C>::value, "");