Skip to content

Commit 2b73759

Browse files
committed
Merge constructors
1 parent 73d9fce commit 2b73759

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

libcxx/include/__memory/indirect.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ class _LIBCPP_NO_SPECIALIZATIONS indirect {
8585
_LIBCPP_HIDE_FROM_ABI constexpr indirect(indirect&& __other) noexcept
8686
: __alloc_(std::move(__other.__alloc_)), __ptr_(std::exchange(__other.__ptr_, nullptr)) {}
8787

88-
_LIBCPP_HIDE_FROM_ABI constexpr indirect(allocator_arg_t, const _Allocator& __a, indirect&& __other) noexcept
89-
requires allocator_traits<_Allocator>::is_always_equal::value
90-
: __alloc_(__a), __ptr_(std::exchange(__other.__ptr_, nullptr)) {}
91-
92-
_LIBCPP_HIDE_FROM_ABI constexpr indirect(allocator_arg_t, const _Allocator& __a, indirect&& __other) : __alloc_(__a) {
93-
if (__other.valueless_after_move()) {
88+
_LIBCPP_HIDE_FROM_ABI constexpr indirect(allocator_arg_t, const _Allocator& __a, indirect&& __other) noexcept(
89+
allocator_traits<_Allocator>::is_always_equal::value)
90+
: __alloc_(__a) {
91+
if constexpr (allocator_traits<_Allocator>::is_always_equal::value) {
92+
__ptr_ = std::exchange(__other.__ptr_, nullptr);
93+
} else if (__other.valueless_after_move()) {
9494
__ptr_ = nullptr;
9595
} else if (__alloc_ == __other.__alloc_) {
9696
__ptr_ = std::exchange(__other.__ptr_, nullptr);

0 commit comments

Comments
 (0)