@@ -64,7 +64,7 @@ struct common_policy_traits {
6464 // UNINITIALIZED
6565 template <class Alloc >
6666 static void transfer (Alloc* alloc, slot_type* new_slot, slot_type* old_slot) {
67- transfer_impl (alloc, new_slot, old_slot, Rank0 {});
67+ transfer_impl (alloc, new_slot, old_slot, Rank2 {});
6868 }
6969
7070 // PRECONDITION: `slot` is INITIALIZED
@@ -83,7 +83,7 @@ struct common_policy_traits {
8383
8484 static constexpr bool transfer_uses_memcpy () {
8585 return std::is_same<decltype (transfer_impl<std::allocator<char >>(
86- nullptr , nullptr , nullptr , Rank0 {})),
86+ nullptr , nullptr , nullptr , Rank2 {})),
8787 std::true_type>::value;
8888 }
8989
@@ -95,18 +95,19 @@ struct common_policy_traits {
9595 }
9696
9797 private:
98- // To rank the overloads below for overload resolution. Rank0 is preferred .
99- struct Rank2 {};
100- struct Rank1 : Rank2 {};
101- struct Rank0 : Rank1 {};
98+ // Use go/ranked- overloads for dispatching .
99+ struct Rank0 {};
100+ struct Rank1 : Rank0 {};
101+ struct Rank2 : Rank1 {};
102102
103103 // Use auto -> decltype as an enabler.
104104 // P::transfer returns std::true_type if transfer uses memcpy (e.g. in
105105 // node_slot_policy).
106106 template <class Alloc , class P = Policy>
107107 static auto transfer_impl (Alloc* alloc, slot_type* new_slot,
108- slot_type* old_slot, Rank0)
109- -> decltype(P::transfer(alloc, new_slot, old_slot)) {
108+ slot_type* old_slot,
109+ Rank2) -> decltype(P::transfer(alloc, new_slot,
110+ old_slot)) {
110111 return P::transfer (alloc, new_slot, old_slot);
111112 }
112113#if defined(__cpp_lib_launder) && __cpp_lib_launder >= 201606
@@ -129,7 +130,7 @@ struct common_policy_traits {
129130
130131 template <class Alloc >
131132 static void transfer_impl (Alloc* alloc, slot_type* new_slot,
132- slot_type* old_slot, Rank2 ) {
133+ slot_type* old_slot, Rank0 ) {
133134 construct (alloc, new_slot, std::move (element (old_slot)));
134135 destroy (alloc, old_slot);
135136 }
0 commit comments