4 ms·
I feel like copy be default makes box a weird paradigm in C++. In Rust you will love unless you write `Clone`.
by Guvante 3y ago
I feel like copy be default makes box a weird paradigm in C++.
In Rust you will love unless you write `Clone`.
- maattdd 3y agoI 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.