4 ms·
None of these features, except the capture clause, are things that anyone has to learn to use C++ lambdas; they should know these other features anyway, from ot
by greyfade 13y ago
None of these features, except the capture clause, are things that anyone has to learn to use C++ lambdas; they should know these other features anyway, from other parts of the language.
The late return type syntax (`-> type`) works with nearly all functions (`auto fn(foo) -> bar { ... }`), the `throw()` (now `noexcept`) specification has been used for long time, and `mutable` is a well-known syntax for potentially const objects; so the lambda syntax is, or at least should be, unsurprising.
To say it's ugly is not saying much. We all know C++ is ugly. This is a given. But singling out lambda syntax, which is comparatively easy to grasp and largely consistent with the language, doesn't really make a case.