Lambda improvements (C++20)
Template syntax for generic lambdas, [=, this], default-constructible stateless lambdas, lambdas in unevaluated contexts, pack expansion in init-capture.
Connected features
Papers
8 · Toronto 2017 → Prague 2020Allows [=, this] capture.
Adds template parameter lists to generic lambdas: []<class T>(T x) {}.
Allows lambdas in unevaluated contexts.
Simplifies the rules for implicit lambda capture.
Makes captureless lambdas default-constructible and assignable.
Allows pack expansion in lambda init-captures.
Deprecates implicit capture of this via [=].
Resolves the init-capture pack grammar.