-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Description
Because a
Box<T>is a pointer, we always know how much space it needs: a
pointer takes up ausizeamount of space.
since a box always has the size of a
usize, no matter what it's pointing to
These are false statements. For example,
assert_eq!(std::mem::size_of::<Box<str>>(), std::mem::size_of::<usize>() * 2);
assert_eq!(std::mem::size_of::<Box<ToString>>(), std::mem::size_of::<usize>() * 2);It would be nice to clarify this (maybe in a footnote) whilst keeping it simple for purposes of the example.