File indexing completed on 2025-01-18 09:29:45
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_CLBL_TRTS_IS_INVOCABLE_HPP
0010 #define BOOST_CLBL_TRTS_IS_INVOCABLE_HPP
0011
0012 #include <boost/callable_traits/detail/core.hpp>
0013 #include <boost/callable_traits/detail/is_invocable_impl.hpp>
0014
0015 namespace boost { namespace callable_traits {
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 template<typename T, typename... Args>
0026 struct is_invocable;
0027
0028
0029 template<typename Ret, typename T, typename... Args>
0030 struct is_invocable_r;
0031
0032
0033 template<typename T, typename... Args>
0034 struct is_invocable : detail::is_invocable_impl<T, Args...>::type {
0035 using type = typename detail::is_invocable_impl<T, Args...>::type;
0036 };
0037
0038 template<typename Ret, typename T, typename... Args>
0039 struct is_invocable_r
0040 : detail::is_invocable_r_impl<
0041 typename detail::is_invocable_impl<T, Args...>::type, Ret, T, Args...>::type
0042 {
0043 using type = typename detail::is_invocable_r_impl<
0044 typename detail::is_invocable_impl<T, Args...>::type, Ret, T, Args...>::type;
0045 };
0046
0047 #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES
0048
0049 template<typename T, typename... Args>
0050 struct is_invocable_v {
0051 static_assert(std::is_same<T, detail::dummy>::value,
0052 "Variable templates not supported on this compiler.");
0053 };
0054
0055 template<typename Ret, typename T, typename... Args>
0056 struct is_invocable_r_v {
0057 static_assert(std::is_same<T, detail::dummy>::value,
0058 "Variable templates not supported on this compiler.");
0059 };
0060
0061 #else
0062
0063
0064 template<typename T, typename... Args>
0065
0066 BOOST_CLBL_TRAITS_INLINE_VAR
0067
0068 constexpr bool is_invocable_v =
0069
0070 detail::is_invocable_impl<T, Args...>::type::value;
0071
0072
0073
0074 template<typename Ret, typename T, typename... Args>
0075
0076 BOOST_CLBL_TRAITS_INLINE_VAR
0077
0078 constexpr bool is_invocable_r_v =
0079
0080 detail::is_invocable_r_impl<
0081 typename detail::is_invocable_impl<T, Args...>::type,
0082 Ret, T, Args...>::type::value;
0083 #endif
0084
0085 }}
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103 #endif