On Thu, Nov 7, 2013 at 8:40 PM, Jason Fager <[email protected]> wrote:

> Let me ask another way:  what's wrong with thinking of ~ just as meaning
> "allocate to the heap and subject to move semantics"?  When would that
> simplification bite me in the ass regarding owned boxes vs strs/vecs?
>
> I get that I should very rarely want that for things that aren't dynamic
> containers or recursive data structures.  But beyond that, am I ever going
> to get myself in trouble not remembering the details of the difference
> between how ~T works vs ~[T]?


The heap allocation is a means to an end rather than a useful property.
There are lots of types in the standard library with destructors, including
most of the containers. There's a deeper connection between TreeMap and an
owned box than between owned vectors and owned boxes.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to