3 ms·
I think what pcwalton might be talking about is this: std::unique_ptr<Person> owner(new Person("name")); auto stolen = std::move(owner); std::cout << owner->
by namelezz 10y ago
I think what pcwalton might be talking about is this:
std::unique_ptr<Person> owner(new Person("name"));
auto stolen = std::move(owner);
std::cout << owner->name << std::endl;
Rust compiler will detect the usage of moved ownership and would not compile. C++ compiler will happily compile but result unhelpful run-time error.