Is it possible to define a callable concept that includes functions and lambdas?
问题 I want to define a concept that would accept all callable objects. Here's what I have done so far: template<typename F> concept Func = std::is_function_v<std::remove_pointer_t<std::decay_t<F>>> || (requires (F f) { std::is_function_v<decltype(f.operator())>; }); bool is_callable(Func auto&&) { return true; } bool is_callable(auto&&) { return false; } Yet if I define those: auto f = [](auto a, auto b, auto c, auto d, auto e) { return a * b * c * d * e; }; int g(int a, int b) { return a + b; }