Skip to content

Commit 270f2fd

Browse files
committed
[libc++] Use a different smart ptr type alias
The `_SP` type is used by some C libraries and this alias could conflict with it.
1 parent 1fb1a5d commit 270f2fd

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

libcxx/include/__memory/inout_ptr.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,17 @@ class _LIBCPP_TEMPLATE_VIS inout_ptr_t {
6363
}
6464
}
6565

66-
using _SP = __pointer_of_or_t<_Smart, _Pointer>;
66+
using _SmartPtr = __pointer_of_or_t<_Smart, _Pointer>;
6767
if constexpr (is_pointer_v<_Smart>) {
68-
std::apply([&](auto&&... __args) { __s_ = _Smart(static_cast<_SP>(__p_), std::forward<_Args>(__args)...); },
68+
std::apply([&](auto&&... __args) { __s_ = _Smart(static_cast<_SmartPtr>(__p_), std::forward<_Args>(__args)...); },
6969
std::move(__a_));
7070
} else if constexpr (__resettable_smart_pointer_with_args<_Smart, _Pointer, _Args...>) {
71-
std::apply([&](auto&&... __args) { __s_.reset(static_cast<_SP>(__p_), std::forward<_Args>(__args)...); },
71+
std::apply([&](auto&&... __args) { __s_.reset(static_cast<_SmartPtr>(__p_), std::forward<_Args>(__args)...); },
7272
std::move(__a_));
7373
} else {
74-
static_assert(is_constructible_v<_Smart, _SP, _Args...>,
74+
static_assert(is_constructible_v<_Smart, _SmartPtr, _Args...>,
7575
"The smart pointer must be constructible from arguments of types _Smart, _Pointer, _Args...");
76-
std::apply([&](auto&&... __args) { __s_ = _Smart(static_cast<_SP>(__p_), std::forward<_Args>(__args)...); },
76+
std::apply([&](auto&&... __args) { __s_ = _Smart(static_cast<_SmartPtr>(__p_), std::forward<_Args>(__args)...); },
7777
std::move(__a_));
7878
}
7979
}

libcxx/include/__memory/out_ptr.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ class _LIBCPP_TEMPLATE_VIS out_ptr_t {
5858
return;
5959
}
6060

61-
using _SP = __pointer_of_or_t<_Smart, _Pointer>;
61+
using _SmartPtr = __pointer_of_or_t<_Smart, _Pointer>;
6262
if constexpr (__resettable_smart_pointer_with_args<_Smart, _Pointer, _Args...>) {
63-
std::apply([&](auto&&... __args) { __s_.reset(static_cast<_SP>(__p_), std::forward<_Args>(__args)...); },
63+
std::apply([&](auto&&... __args) { __s_.reset(static_cast<_SmartPtr>(__p_), std::forward<_Args>(__args)...); },
6464
std::move(__a_));
6565
} else {
66-
static_assert(is_constructible_v<_Smart, _SP, _Args...>,
66+
static_assert(is_constructible_v<_Smart, _SmartPtr, _Args...>,
6767
"The smart pointer must be constructible from arguments of types _Smart, _Pointer, _Args...");
68-
std::apply([&](auto&&... __args) { __s_ = _Smart(static_cast<_SP>(__p_), std::forward<_Args>(__args)...); },
68+
std::apply([&](auto&&... __args) { __s_ = _Smart(static_cast<_SmartPtr>(__p_), std::forward<_Args>(__args)...); },
6969
std::move(__a_));
7070
}
7171
}

0 commit comments

Comments
 (0)