4 ms·
"...and newly C++"? C++11 had move semantics. So did C++14 and C++17. C++20 still does. It is a stretch to suggest Rust had them longer, considering Rust 1.0 ca
by ncmncm 6y ago
"...and newly C++"? C++11 had move semantics. So did C++14 and C++17. C++20 still does. It is a stretch to suggest Rust had them longer, considering Rust 1.0 came out well after C++11, and cribbed them. It is a shame that C++ can't be move-by-default and const-by-default, but that's backward compatibility for you.
Rewriting the Rust std lib to use RefCell everywhere would be possible, but would make it almost entirely useless.
- gpderetta 6y agoMove semantics even predate C++11. The need for move only types was identified very and such types have existed in various form for a ling time.
- bregma 6y agoC++98 had move semantics using std::auto_ptr.
- correct_horse 6y agoI probably shouldn't have said newly C++, but my frame of mind was relative to the lifespan of the language. > Rewriting the Rust std lib to use RefCell everywhere would be possible, but would make it almost entirely useless. Maybe not useless, but certainly worse than it currently is. The point is that you can switch one function to using RefCell (a breaking change, but) totally possible
- ncmncm 6y agoI would admit "and lately, C++".