3 ms·
Rust's `Clone` trait is deep by default, except for - Types with shared semantics (e.g. Rc<T>, Arc<T>), or holding onto these internally - Types holding borro
by yoklov 8y ago
Rust's `Clone` trait is deep by default, except for
- Types with shared semantics (e.g. Rc<T>, Arc<T>), or holding onto these internally
- Types holding borrowed references (these will still reference the same data).
C++'s copy constructors are too, but there are more caveats, although they're similar in principal to Rust's caveats.