Wednesday 6 April 2016

c++11 - What's the meaning of [=](...){...} in C++?

What is the effect of this statement:



std::replace_if(ln.begin(),ln.end(),[=](int c){return c=='\n'||c==' ';},0);


Specifically, I'd like to know:



What's the meaning of




[=](int c){return c=='\n'||c==' ';}


Where's the grammar for this defined?

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...