Why doesn't std::is_invocable work with templated operator() which return type is auto-deduced (eg. generic lambdas)
问题 c++17 introduces template <class Fn, class...ArgTypes> struct is_invocable: Determines whether Fn can be invoked with the arguments ArgTypes... . Formally, determines whether INVOKE(declval<Fn>(), declval<ArgTypes>()...) is well formed when treated as an unevaluated operand, where INVOKE is the operation defined in Callable . However, this template does not work with templated operator() which (direct or indirect) return type is auto-deduced: #include <type_traits> #include <iostream> struct