Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
einpoklum
on Aug 26, 2022
|
parent
|
context
|
favorite
| on:
Rust – A hard decision pays off
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.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: