123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- #ifndef BOOST_CLBL_TRTS_IS_INVOCABLE_HPP
- #define BOOST_CLBL_TRTS_IS_INVOCABLE_HPP
- #include <boost/callable_traits/detail/core.hpp>
- #include <boost/callable_traits/detail/is_invocable_impl.hpp>
- namespace boost { namespace callable_traits {
- template<typename T, typename... Args>
- struct is_invocable;
- template<typename Ret, typename T, typename... Args>
- struct is_invocable_r;
- template<typename T, typename... Args>
- struct is_invocable : detail::is_invocable_impl<T, Args...>::type {
- using type = typename detail::is_invocable_impl<T, Args...>::type;
- };
- template<typename Ret, typename T, typename... Args>
- struct is_invocable_r
- : detail::is_invocable_r_impl<
- typename detail::is_invocable_impl<T, Args...>::type, Ret, T, Args...>::type
- {
- using type = typename detail::is_invocable_r_impl<
- typename detail::is_invocable_impl<T, Args...>::type, Ret, T, Args...>::type;
- };
- #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES
- template<typename T, typename... Args>
- struct is_invocable_v {
- static_assert(std::is_same<T, detail::dummy>::value,
- "Variable templates not supported on this compiler.");
- };
- template<typename Ret, typename T, typename... Args>
- struct is_invocable_r_v {
- static_assert(std::is_same<T, detail::dummy>::value,
- "Variable templates not supported on this compiler.");
- };
- #else
- template<typename T, typename... Args>
- BOOST_CLBL_TRAITS_INLINE_VAR
- constexpr bool is_invocable_v =
- detail::is_invocable_impl<T, Args...>::type::value;
- template<typename Ret, typename T, typename... Args>
- BOOST_CLBL_TRAITS_INLINE_VAR
- constexpr bool is_invocable_r_v =
- detail::is_invocable_r_impl<
- typename detail::is_invocable_impl<T, Args...>::type,
- Ret, T, Args...>::type::value;
- #endif
- }}
- #endif
|