In C++0x we can now do :
void dosomething( std::vector<Thing>& things )
{
for( Thing& thing : things )
{
dofoo( thing );
wiizzz( thing );
tadaa( thing );
}
}
I know that the addition and use of lambda is syntactic sugar but it provide interesting optimization opportunities.
What about the for loop? Is it only syntactic sugar or can the compiler optimize some cases that it couldn't or would be too hard to do with handwritten loop?