@penguin42 C++11 introduced move semantics, which enabled unique_ptr as well as other innovations.
Rust's ownership model is designed around move semantics, while in C++ it has to coexist with the old copy semantics.
If an object has move semantics, it can be moved or swapped cheaply and without throwing. This assumption is essential for performant vectors and other data structures.
@penguin42 RAII (strong resource encapsulation and ownership) is also a central design principle in Rust and modern C++:
https://en.cppreference.com/w/cpp/language/raii
#programming #cpp