What is a lambda expression in C++11?
The problem C++ includes useful generic functions like std::for_each and std::transform, which can be very handy. Unfortunately they can also be quite cumbersome to use, particularly if the functor you would like to apply is unique to the particular function. #include <algorithm> #include <vector> namespace { struct f { void operator()(int) { // do something … Read more