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; }
38 typedef std::set<MoveOnly> C;
39 LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
42 typedef std::set<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
43 LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
46 typedef std::set<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
47 LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
50 typedef std::set<MoveOnly, some_comp<MoveOnly>> C;
51 static_assert(!std::is_nothrow_move_constructible<C>::value, "");