Re:Lambda expression comparison between C++11, C++14 and C++17
by aurelian15 on Saturday May 14, 2016 @06:06PM
(#11698268)
Nice overview. Just a small correction: the smallest possible lambda is
and not
as stated in the article. The parameter list is optional.
[ Parent
| on HN ]
Re:Lambda expression comparison between C++11, C++14 and C++17
by hellofunk on Sunday May 15, 2016 @01:53AM
(#11699665)
>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++.