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 //===----------------------------------------------------------------------===//
14 // is_nothrow_default_constructible<allocator_type>::value &&
15 // is_nothrow_default_constructible<key_compare>::value &&
16 // is_nothrow_copy_constructible<key_compare>::value);
18 // This tests a conforming extension
20 // UNSUPPORTED: c++98, c++03
22 #include <unordered_map>
25 #include "test_macros.h"
27 #include "test_allocator.h"
28 #include "../../../test_hash.h"
35 some_comp(const some_comp&);
36 bool operator()(const T&, const T&) const { return false; }
44 some_hash(const some_hash&);
46 std::size_t operator()(T const&) const;
51 #if defined(_LIBCPP_VERSION)
53 typedef std::unordered_map<MoveOnly, MoveOnly> C;
54 static_assert(std::is_nothrow_default_constructible<C>::value, "");
57 typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
58 std::equal_to<MoveOnly>, test_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
59 static_assert(std::is_nothrow_default_constructible<C>::value, "");
61 #endif // _LIBCPP_VERSION
63 typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
64 std::equal_to<MoveOnly>, other_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
65 static_assert(!std::is_nothrow_default_constructible<C>::value, "");
68 typedef std::unordered_map<MoveOnly, MoveOnly, some_hash<MoveOnly>> C;
69 static_assert(!std::is_nothrow_default_constructible<C>::value, "");
72 typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
73 some_comp<MoveOnly>> C;
74 static_assert(!std::is_nothrow_default_constructible<C>::value, "");