Here's a nice lambda synopsis with some usage notes.
Some notes on C++11 lambda functions
by Ranju V.
From the article:
Bjarne Stroustrup says that C++11, which is the latest ratified revision of the C++ standard, “feels like a new language”. I think lambda functions are a big part of what makes the language feel so very different from C++03. Lambda functions basically allow you to do things like this:
vector<int> nums { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; auto evens = count_if(begin(nums), end(nums), [](int num) { return (num % 2) == 0; });
Add a Comment
Comments are closed.