Re:Tour of Rust
by umanwizard on Sunday July 12, 2020 @09:01AM
(#23811004)
AFAICT, Box has exactly the same semantics as C++‘s unique_ptr.
[ Parent
| on HN ]
Where it can have the same semantics, yes. But if you look at the details, not exactly. For example Box is not nullable, but a not-nullable C++ equivalent is hard to do given the rest of the language.
Re:Tour of Rust
by umanwizard on Sunday July 12, 2020 @11:26AM
(#23812043)
Good point on the nullability; yes, that is indeed different from std::unique_ptr.