Tag: C++11 Lambda : How to capture member variables inside Lambda function
C++11 Lambda : How to capture member variables inside Lambda function
In this article we will discuss how to capture member variables from outer scope. Suppose we have a class OddCounter to keep the track of odd numbers read by the object. Inside its member function we are creating a lambda function and passing to a STL algorithm std::for_each. Advertisements Now this lambda function needs to capture …
C++11 Lambda : How to capture member variables inside Lambda functionRead More