1 //===----------------------------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef _LIBCPP___TYPE_TRAITS_STRIP_SIGNATURE_H 10 #define _LIBCPP___TYPE_TRAITS_STRIP_SIGNATURE_H 11 12 #include <__config> 13 14 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 15 # pragma GCC system_header 16 #endif 17 18 #if _LIBCPP_STD_VER >= 17 19 20 _LIBCPP_BEGIN_NAMESPACE_STD 21 22 template <class _Fp> 23 struct __strip_signature; 24 25 # if defined(__cpp_static_call_operator) && __cpp_static_call_operator >= 202207L 26 27 template <class _Rp, class... _Args> 28 struct __strip_signature<_Rp (*)(_Args...)> { 29 using type = _Rp(_Args...); 30 }; 31 32 template <class _Rp, class... _Args> 33 struct __strip_signature<_Rp (*)(_Args...) noexcept> { 34 using type = _Rp(_Args...); 35 }; 36 37 # endif // defined(__cpp_static_call_operator) && __cpp_static_call_operator >= 202207L 38 39 // clang-format off 40 template<class _Rp, class _Gp, class ..._Ap> 41 struct __strip_signature<_Rp (_Gp::*) (_Ap...)> { using type = _Rp(_Ap...); }; 42 template<class _Rp, class _Gp, class ..._Ap> 43 struct __strip_signature<_Rp (_Gp::*) (_Ap...) const> { using type = _Rp(_Ap...); }; 44 template<class _Rp, class _Gp, class ..._Ap> 45 struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile> { using type = _Rp(_Ap...); }; 46 template<class _Rp, class _Gp, class ..._Ap> 47 struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile> { using type = _Rp(_Ap...); }; 48 49 template<class _Rp, class _Gp, class ..._Ap> 50 struct __strip_signature<_Rp (_Gp::*) (_Ap...) &> { using type = _Rp(_Ap...); }; 51 template<class _Rp, class _Gp, class ..._Ap> 52 struct __strip_signature<_Rp (_Gp::*) (_Ap...) const &> { using type = _Rp(_Ap...); }; 53 template<class _Rp, class _Gp, class ..._Ap> 54 struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile &> { using type = _Rp(_Ap...); }; 55 template<class _Rp, class _Gp, class ..._Ap> 56 struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile &> { using type = _Rp(_Ap...); }; 57 58 template<class _Rp, class _Gp, class ..._Ap> 59 struct __strip_signature<_Rp (_Gp::*) (_Ap...) noexcept> { using type = _Rp(_Ap...); }; 60 template<class _Rp, class _Gp, class ..._Ap> 61 struct __strip_signature<_Rp (_Gp::*) (_Ap...) const noexcept> { using type = _Rp(_Ap...); }; 62 template<class _Rp, class _Gp, class ..._Ap> 63 struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile noexcept> { using type = _Rp(_Ap...); }; 64 template<class _Rp, class _Gp, class ..._Ap> 65 struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile noexcept> { using type = _Rp(_Ap...); }; 66 67 template<class _Rp, class _Gp, class ..._Ap> 68 struct __strip_signature<_Rp (_Gp::*) (_Ap...) & noexcept> { using type = _Rp(_Ap...); }; 69 template<class _Rp, class _Gp, class ..._Ap> 70 struct __strip_signature<_Rp (_Gp::*) (_Ap...) const & noexcept> { using type = _Rp(_Ap...); }; 71 template<class _Rp, class _Gp, class ..._Ap> 72 struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile & noexcept> { using type = _Rp(_Ap...); }; 73 template<class _Rp, class _Gp, class ..._Ap> 74 struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile & noexcept> { using type = _Rp(_Ap...); }; 75 // clang-format on 76 77 _LIBCPP_END_NAMESPACE_STD 78 79 #endif // _LIBCPP_STD_VER >= 17 80 81 #endif // _LIBCPP___TYPE_TRAITS_STRIP_SIGNATURE_H 82