How to convert a lambda to an std::function using templates
You can’t pass a lambda function object as an argument of type std::function<T> without explicitly specifying the template argument T. Template type deduction tries to match the type of your lambda function to the std::function<T> which it just can’t do in this case – these types are not the same. Template type deduction doesn’t consider … Read more