3 ms·
Before C++11, if you wanted to pass a function with closure-like behavior to an STL algorithm, you had to write a little class with operator() overloaded. It wa
by blt 13y ago
Before C++11, if you wanted to pass a function with closure-like behavior to an STL algorithm, you had to write a little class with operator() overloaded. It was a huge pain in the ass, lots of boilerplate code. Most programmers didn't bother and wrote plain loops.
Now with C++11 lambdas, std::algorithm is much nicer to use.