Closed eugnsp closed 4 years ago
It seems that is_invocable_v variable template is broken. is_invocable and is_invocable_v have different implementations:
is_invocable_v
is_invocable
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 T, typename... Args> constexpr bool is_invocable_v = detail::is_invocable_impl<detail::traits<T>, Args...>::type::value;
With my understanding, it is not detail::traits<T> that should be checked for invocability, but simply T. As a result, this assertion fails:
detail::traits<T>
T
#include <boost/callable_traits.hpp> int test(int) { return 0; } static_assert( boost::callable_traits::is_invocable_v<decltype(test), int> == boost::callable_traits::is_invocable<decltype(test), int>::value );
Originally reported here: https://stackoverflow.com/q/61696567
Thanks for the bug report, this is gross. Will fix for Boost 1.74 as well as the missing test coverage.
Fixed via #185
It seems that
is_invocable_v
variable template is broken.is_invocable
andis_invocable_v
have different implementations:With my understanding, it is not
detail::traits<T>
that should be checked for invocability, but simplyT
. As a result, this assertion fails:Originally reported here: https://stackoverflow.com/q/61696567