2 ms·
> C++ doesn't actually need it. Rust proved that capture everything by reference or capture everything by move is enough for all practical use cases. That's ki
by masklinn 7y ago
> C++ doesn't actually need it. Rust proved that capture everything by reference or capture everything by move is enough for all practical use cases.
That's kinda true but kinda not: precise "capture clauses" is a common design pattern in rust[0] showing that the flexibility is extremely useful, and I think I've seen rumblings about adding them to the language.
I mean technically you only ever need `move` closure, "ref" closures are already a convenience.
[0] http://smallcultfollowing.com/babysteps/blog/2018/04/24/rust-pattern-precise-closure-capture-clauses/ http://smallcultfollowing.com/babysteps/blog/2018/04/24/rust...