24 ms·
No, it should move properly when passing by value (as in, essentially the rust move semantics). If you want a copy, that should be explicit.
by hgomersall 11mo ago
No, it should move properly when passing by value (as in, essentially the rust move semantics). If you want a copy, that should be explicit.
- hyghjiyhu 11mo agoMoving by default would be too much of a footgun without a borrow checker imo.
- hgomersall 11mo agoI think using a language without a borrow checker is already a massive footgun (albeit less of one for GC/RC languages). More sensible move semantics would still be a big ergonomic improvement.
- kccqzy 11mo agoI think the language allowing use-after-move is honestly a smaller footgun than allowing using uninitialized memory or use-after-free. C++ already has the latter.