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 //===----------------------------------------------------------------------===//
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
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; }
37 typedef std::pair<const MoveOnly, MoveOnly> V;
39 typedef std::map<MoveOnly, MoveOnly> C;
40 LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
43 typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
44 LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
47 typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
48 LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
51 typedef std::map<MoveOnly, MoveOnly, some_comp<MoveOnly>> C;
52 static_assert(!std::is_nothrow_move_constructible<C>::value, "");