[libcxx-commits] [libcxx] 832517f - [libc++] Add alias template for __strip_signature::type (#181955)
via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Mar 6 09:49:43 PST 2026
Author: William Fynn
Date: 2026-03-06T17:49:39Z
New Revision: 832517f28d4b47bb03d7a310d99279552da2aa8d
URL: https://github.com/llvm/llvm-project/commit/832517f28d4b47bb03d7a310d99279552da2aa8d
DIFF: https://github.com/llvm/llvm-project/commit/832517f28d4b47bb03d7a310d99279552da2aa8d.diff
LOG: [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.
Added:
Modified:
libcxx/include/__functional/function.h
libcxx/include/__type_traits/strip_signature.h
libcxx/include/future
Removed:
################################################################################
diff --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h
index c1675879ec19f..d3a978ac862db 100644
--- a/libcxx/include/__functional/function.h
+++ b/libcxx/include/__functional/function.h
@@ -684,7 +684,7 @@ class function<_Rp(_ArgTypes...)>
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
diff --git a/libcxx/include/__type_traits/strip_signature.h b/libcxx/include/__type_traits/strip_signature.h
index c8b33278737ed..1ff5b3d9ec620 100644
--- a/libcxx/include/__type_traits/strip_signature.h
+++ b/libcxx/include/__type_traits/strip_signature.h
@@ -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
diff --git a/libcxx/include/future b/libcxx/include/future
index 4084148e52af6..6bd836afa04e8 100644
--- a/libcxx/include/future
+++ b/libcxx/include/future
@@ -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
More information about the libcxx-commits
mailing list