2 ms·
I consider C++ a copy-by-default language (and pointer/ref being the necessary evil which breaks this great default). In Rust, it's move by default and you nee
by maattdd 3y ago
I consider C++ a copy-by-default language (and pointer/ref being the necessary evil which breaks this great default).
In Rust, it's move by default and you need an explicit .clone()
In C++, it's copy by default and you need an explicit std::move()
- Guvante 3y agoA copy of a pointer is a duplicate pointer to the same location by C++'s rules.