1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 // map& operator=(map&& c)
13 // allocator_type::propagate_on_container_move_assignment::value &&
14 // is_nothrow_move_assignable<allocator_type>::value &&
15 // is_nothrow_move_assignable<key_compare>::value);
17 // This tests a conforming extension
24 #include "test_macros.h"
26 #include "test_allocator.h"
32 some_comp
& operator=(const some_comp
&);
33 bool operator()(const T
&, const T
&) const { return false; }
38 typedef std::pair
<const MoveOnly
, MoveOnly
> V
;
40 typedef std::map
<MoveOnly
, MoveOnly
> C
;
41 static_assert(std::is_nothrow_move_assignable
<C
>::value
, "");
44 typedef std::map
<MoveOnly
, MoveOnly
, std::less
<MoveOnly
>, test_allocator
<V
>> C
;
45 static_assert(!std::is_nothrow_move_assignable
<C
>::value
, "");
47 #if defined(_LIBCPP_VERSION)
49 typedef std::map
<MoveOnly
, MoveOnly
, std::less
<MoveOnly
>, other_allocator
<V
>> C
;
50 static_assert(std::is_nothrow_move_assignable
<C
>::value
, "");
52 #endif // _LIBCPP_VERSION
54 typedef std::map
<MoveOnly
, MoveOnly
, some_comp
<MoveOnly
>> C
;
55 static_assert(!std::is_nothrow_move_assignable
<C
>::value
, "");