#include <functional>
struct R {};
template<class... PP> void f(std::function<R(PP...)>) {}
struct P {};
int main() {
// No matching function for call to 'f'.
// Candidate template ignored: could not match 'std::function<R (PP...)>' against '(lambda at ...)'
f([&](P) { return R{}; });
// То же самое.
// UPD: Впрочем, не совсем: тут could not match 'std::function<R (P, PP...)>'. Бред какой-то.
f<P>([&](P) -> R { return R{}; });
}