Interesting (To me)

Looking through code recently written I noticed that I was using std::for_each where the new syntax of range based for would have sufficed. Given how it was used, I don’t understand why I didn’t use the new syntax… std::vector < int > vec; for( int c : vec ) {     //… } vs… std::vector < int > vec; std::for_each( vec.begin(), vec.end(), [&]( int c ) {     //… } ); The new range based for is […]