How can I make trailing return type deduction in the following code snippet that uses a template function? Code works well as it is now, but I need to know if I can also add trailing return for the lambda function..
template<class T>
T print(T a){
cout << a;
return a;
};
int main()
{
auto print_int = [](int a)/*->How?*/{
return print<int>(a);
};
print_int(4);
}
You can do the following: