2 ms·
With C++ lambdas, it's similar, but the syntax is a bit uglier: [](auto&& x) { return get_something_complicated(bar(x)); } and you can decide whether you wa
by einpoklum 4y ago
With C++ lambdas, it's similar, but the syntax is a bit uglier:
[](auto&& x) { return get_something_complicated(bar(x)); }
and you can decide whether you want a value (no &'s), an lvalue reference (&), or a forwarding reference (&&). I think with C++20 you can also use a concept instead of auto for a constrained parameter type.