Content deleted Content added
→C++ (since C++11): Updated the generic lambda syntax |
→C++ (since C++11): Already possible |
||
Line 722:
</syntaxhighlight>
In addition to that, C++23 modified the syntax so that the parentheses can be omitted in the case of a lambda that takes no arguments even if the lambda has a specifier. It also made it so that an attribute specifier sequence that appears before the parameter list, lambda specifiers, or noexcept specifier (there must be one of them) applies to the function call operator or operator template of the closure type. Otherwise, it applies to the type of the function call operator or operator template. Previously, such a sequence always applied to the type of the function call operator or operator template of the closure type making e.g the <code>[<nowiki/>[noreturn]]</code> attribute impossible to use with lambdas.
The [[Boost (C++ libraries)|Boost]] library provides its own syntax for lambda functions as well, using the following syntax:<ref>{{cite web |url=http://www.boost.org/doc/libs/1_57_0/doc/html/lambda.html|title=Chapter 16. Boost.Lambda|last1=Järvi|first1=Jaakko|last2=Powell|first2=Gary|date=n.d.|website=Boost Documentation|publisher=Boost|access-date=December 22, 2014}}</ref>
|