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 template<class _Rp, class _Gp, class ..._Ap> 40 struct __strip_signature<_Rp (_Gp::*) (_Ap...)> { using type = _Rp(_Ap...); }; 41 template<class _Rp, class _Gp, class ..._Ap> 42 struct __strip_signature<_Rp (_Gp::*) (_Ap...) const> { using type = _Rp(_Ap...); }; 43 template<class _Rp, class _Gp, class ..._Ap> 44 struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile> { using type = _Rp(_Ap...); }; 45 template<class _Rp, class _Gp, class ..._Ap> 46 struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile> { using type = _Rp(_Ap...); }; 47 48 template<class _Rp, class _Gp, class ..._Ap> 49 struct __strip_signature<_Rp (_Gp::*) (_Ap...) &> { using type = _Rp(_Ap...); }; 50 template<class _Rp, class _Gp, class ..._Ap> 51 struct __strip_signature<_Rp (_Gp::*) (_Ap...) const &> { using type = _Rp(_Ap...); }; 52 template<class _Rp, class _Gp, class ..._Ap> 53 struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile &> { using type = _Rp(_Ap...); }; 54 template<class _Rp, class _Gp, class ..._Ap> 55 struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile &> { using type = _Rp(_Ap...); }; 56 57 template<class _Rp, class _Gp, class ..._Ap> 58 struct __strip_signature<_Rp (_Gp::*) (_Ap...) noexcept> { using type = _Rp(_Ap...); }; 59 template<class _Rp, class _Gp, class ..._Ap> 60 struct __strip_signature<_Rp (_Gp::*) (_Ap...) const noexcept> { using type = _Rp(_Ap...); }; 61 template<class _Rp, class _Gp, class ..._Ap> 62 struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile noexcept> { using type = _Rp(_Ap...); }; 63 template<class _Rp, class _Gp, class ..._Ap> 64 struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile noexcept> { using type = _Rp(_Ap...); }; 65 66 template<class _Rp, class _Gp, class ..._Ap> 67 struct __strip_signature<_Rp (_Gp::*) (_Ap...) & noexcept> { using type = _Rp(_Ap...); }; 68 template<class _Rp, class _Gp, class ..._Ap> 69 struct __strip_signature<_Rp (_Gp::*) (_Ap...) const & noexcept> { using type = _Rp(_Ap...); }; 70 template<class _Rp, class _Gp, class ..._Ap> 71 struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile & noexcept> { using type = _Rp(_Ap...); }; 72 template<class _Rp, class _Gp, class ..._Ap> 73 struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile & noexcept> { using type = _Rp(_Ap...); }; 74 75 _LIBCPP_END_NAMESPACE_STD 76 77 #endif // _LIBCPP_STD_VER >= 17 78 79 #endif // _LIBCPP___TYPE_TRAITS_STRIP_SIGNATURE_H 80