[libc++] Add alias template for __strip_signature::type (#181955)

Simplifying the internal implementation by providing a more concise
way to access the underlying type within the __strip_signature class.
This commit is contained in:
William Fynn
2026-03-06 17:49:39 +00:00
committed by GitHub
parent ec9e16444e
commit 832517f28d
3 changed files with 5 additions and 2 deletions

View File

@@ -684,7 +684,7 @@ public:
template <class _Rp, class... _Ap>
function(_Rp (*)(_Ap...)) -> function<_Rp(_Ap...)>;
template <class _Fp, class _Stripped = typename __strip_signature<decltype(&_Fp::operator())>::type>
template <class _Fp, class _Stripped = __strip_signature_t<decltype(&_Fp::operator())>>
function(_Fp) -> function<_Stripped>;
# endif // _LIBCPP_STD_VER >= 17

View File

@@ -74,6 +74,9 @@ template<class _Rp, class _Gp, class ..._Ap>
struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile & noexcept> { using type _LIBCPP_NODEBUG = _Rp(_Ap...); };
// clang-format on
template <class _Fp>
using __strip_signature_t _LIBCPP_NODEBUG = typename __strip_signature<_Fp>::type;
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_STD_VER >= 17

View File

@@ -1749,7 +1749,7 @@ public:
template <class _Rp, class... _Args>
packaged_task(_Rp (*)(_Args...)) -> packaged_task<_Rp(_Args...)>;
template <class _Fp, class _Stripped = typename __strip_signature<decltype(&_Fp::operator())>::type>
template <class _Fp, class _Stripped = __strip_signature_t<decltype(&_Fp::operator())>>
packaged_task(_Fp) -> packaged_task<_Stripped>;
# endif