here is the sample code
#include <iostream>
template<typename T>
T foo(T(*fp)())
{
return fp();
}
int main()
{
std::cout<<foo([]->int{ return 1; });
}
when I compiled the code above, compiler says it cannot deduce the template argument, but I have specified the return type of lambda.