3 ms·
> The documentation for Box is literally (emph mine): > >> A pointer type that uniquely owns a heap allocation of type T. > Until that documentation changes I
by CodeMage 2y ago
> The documentation for Box is literally (emph mine):
> >> A pointer type that uniquely owns a heap allocation of type T.
> Until that documentation changes I find the article's point quite valid.
I think there's some confusion here and that it's because the concept of "pointer" is slightly overloaded.
One overload of the meaning is "first-class pointer types": https://doc.rust-lang.org/reference/types/pointer.html https://doc.rust-lang.org/reference/types/pointer.html
The other overload, the one used in the docs for Box, Rc, and such, is basically "anything that implements Deref". People who say "Box is not a pointer" are referring to the fact that Box is not a first-class pointer type, i.e. it's neither a reference nor a raw pointer.