C++0x and the Lack of Polymorphic Lambdas - Why?
- by Dominar
I've been reviewing the draft version of the upcoming C++0x standard. Specifically the section on lambdas, and am confused as to the reasoning for not introducing polymorphic lambdas.
I had hoped we could use code such as the following:
template<typename Container>
void foo(Container c)
{
for_each(c.begin(),c.end(),[](T& t) { ++t; });
}
What were the reasons:
Was it the committee ran out of time?
That polymorphic lambdas are too hard to implement?
Or perhaps that they are seen as not being needed by the PTB?