3 ms·
Would auto_ptr/unique_ptr have been a better comparison?
by pohl 12y ago
Would auto_ptr/unique_ptr have been a better comparison?
- steveklabnik 12y ago`unique_ptr` is like `Box<T>` (the old `~`).
- pohl 12y agoWell this is all very humbling. I'm a mostly "managed language" weenie at the moment, but I swear I've read the phrase "ownership semantics" in reference to something in this neck of the C++ woods. Rust is shaping up to pass the Alan Perlis test quite handily as a language worth studying.
- steveklabnik 12y agoNo worries. :) Yes, see, in C++, you still need to think about ownership, the compiler just can't help you out. One way of thinking about Rust is "C++, but the compiler understands ownership and memory lifetime." https://github.com/mozilla/rust/wiki/Rust-for-CXX-programmers https://github.com/mozilla/rust/wiki/Rust-for-CXX-programmer... is a bit outdated, but you may enjoy giving it a glance.
- DanWaterworth 12y agoFor the uninitiated (like me 20 seconds ago): A language that doesn't change the way you think about programming is not worth learning. - Alan Perlis
- TheCoelacanth 12y ago`&`/`mut &` in Rust is equivalent to `const &`/`&` in C++, but with the addition that the compiler makes sure that you don't keep it around for longer than is valid.