After a large time gap between large C++ systems, been catching up on the language. Feels like meeting a high-school friend who you didn’t friend on Facebook.
One of the things that got me to realize that this was not my childhood’s C++ was the existence of lambdas.
At first, I was like: EWWWW… First we had Java envy and now we have Scala envy… does anything ever change.
Except now that I am starting to dig into this little feature, the fact that you can write this piece of code is wicked convenient:
vector<int> v; v.push_back( 1 ); v.push_back( 2 ); //... for_each( v.begin(), v.end(), [] (int val) { cout << val; } );
My personal frustration with using STL may be finally overcome…
Leave a Reply