For the following code:
auto F(int count) -> decltype([](int m) { return 0; })
{
return [](int m) { return 0; };
}
g++ 4.5 gives the errors:
test1.cpp:1:32: error: expected primary-expression before 'int'
test1.cpp:1:32: error: expected ')' before 'int'
What is the problem? What is the correct way to return a lambda from a function?