Closed
Description
From http://doc.rust-lang.org/nightly/book/pointers.html#best-practices-1:
Best practices
Boxes are appropriate to use in two situations: Recursive data structures, and occasionally, when returning data.
However, the book doesn't explain when is it appropriate to return Boxes and even suggests that one should never return Box pointers in http://doc.rust-lang.org/nightly/book/pointers.html#returning-data:
Returning data
This is important enough to have its own section entirely. The TL;DR is this: you don't generally want to return pointers, even when you might in a language like C or C++.
This caused confusion for me whether there really is a reason to return Boxes. Even if there is, I was clueless on what it might be.
Metadata
Metadata
Assignees
Labels
No labels