| ▲ | timschmidt 3 hours ago | |
> I like the concepts proposed by Rust but do not like fighting with the borrow checker or sprinkling code with box, ref, cell, rc, refcell, etc. I'm not sure why this would be confusing or disliked by a C++ dev. Rust's Box<T> is similar to C++'s std::unique_ptr<T>. Rust's Rc<T>, Arc<T>, and Rc<RefCell<T>> serve similar uses to C++'s std::shared_ptr<T>. Rust's Weak<T> is similar to C++'s std::weak_ptr<T>. Verbosity of both is nearly identical. The big difference is that Rust enforces the rules around aliasing and mutability at compile time, whereas with C++ I get to find out I've made a mistake when my running code crashes. | ||