Example
The implementation currently supports the following features of the proposal:
1std::transform (begin, end, result
2 <> (3int n) 4 : [5&s 6= sum] 7(s += n, '0' + (s % 10))
);
2 <> (3int n) 4 : [5&s 6= sum] 7(s += n, '0' + (s % 10))
);
- Lambda expressions are usable with the std::CallableN class of concepts.
- A lambda function can be defined wherever a primary-expression is expected.
- Argument types must be explicitly specified.
- Return types are deducable and thus, may be omitted.
- Each external reference and its storage mechanism must be explicitly declared. An unadorned name means by-copy; an ampersand (&) means by-reference.
- Initializer expressions, which are not part of the proposal (yet), are supported.
- The body may be either a parenthesized-expression, enabling return type deduction, or a compound-statement, disabling it.