diff --git a/include/clipp.h b/include/clipp.h index d7b101e..a1bec2d 100644 --- a/include/clipp.h +++ b/include/clipp.h @@ -155,16 +155,27 @@ namespace traits { * @brief function (class) signature type trait * *****************************************************************************/ +#if defined(__cpp_lib_is_invocable) template constexpr auto check_is_callable(int) -> decltype( std::declval()(std::declval()...), std::integral_constant::type>::value>{} ); + std::is_same::type>::value>{} ); -template +template constexpr auto -check_is_callable(long) -> std::false_type; +check_is_callable_without_arg(int) -> decltype( + std::declval()(), + std::integral_constant::type>::value>{} ); +#else +template +constexpr auto +check_is_callable(int) -> decltype( + std::declval()(std::declval()...), + std::integral_constant::type>::value>{} ); template constexpr auto @@ -172,6 +183,11 @@ check_is_callable_without_arg(int) -> decltype( std::declval()(), std::integral_constant::type>::value>{} ); +#endif + +template +constexpr auto +check_is_callable(long) -> std::false_type; template constexpr auto