4 ms·
Nice overview. Just a small correction: the smallest possible lambda is []{} and not [](){} as stated in the article. The parameter list is optional
by aurelian15 10y ago
Nice overview. Just a small correction: the smallest possible lambda is
[]{}
and not
[](){}
as stated in the article. The parameter list is optional.
- hellofunk 10y ago>The parameter list is optional. To avoid confusion, only an empty parameter list is optional. You can't omit the parameter list if you take args, unlike lambda shortcuts in languages like clojure which allow you to implicitly refer to arguments inside the body using a universal variable name, and therefore omit the parameter list for all lambdas. That possibility does not exist in c++.