Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Guide: motivate Box and Rc pointers with need, uses, benefits, and ex…
…amples. Explain that Rust has different pointer types because there is a tradeoff between flexibility and efficiency. Motivate boxes as fixed-size containers of variable-sized objects. Clarify that Box and Rc are pointer types that you deref with * just like references. Stick to explaining the semantics and avoid implementation details. Scope isn't the most accurate framework to think about deallocation (since you return boxes and otherwise move values out of scopes); it's more "when the value is done being used," i.e., lifetime. Provide a connection between Rust's pointer types by locating them on a flexibiltiy / performance scale. Explain the compiler can't statically analyze lifetimes with multiple owners; hence the need for (runtime) reference counting.
- Loading branch information
John Kleint
committed
Oct 27, 2014
1 parent
f037452
commit d257b37
Showing
1 changed file
with
78 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters