Possible Duplicate:
C++0x and the Lack of Polymorphic Lambdas - Why?
C++0x lambda expressions support return type inference to some point. Why aren't argument types determined automatically, too?
Eg, why can't I write:
void somefunc(const std::vector<int>& v)
{
std::sort(v.begin(), v.end(), [](x, y) { return x < y; });
}
It would seem that the compiler should be able to figure out that x
and y
are of type int
.