Can you speak a little to the practical differences between owned boxes and
~[T]/~str?  How does the difference affect how I should use each?

On Thursday, November 7, 2013, Daniel Micay wrote:

> On Thu, Nov 7, 2013 at 6:32 PM, Liigo Zhuang 
> <[email protected]<javascript:_e({}, 'cvml', '[email protected]');>
> > wrote:
>
>> > Owned boxes shouldn't be commonly used. There's close to no reason to
>> use one for anything but a recursive data structure or in rare cases for an
>> owned trait object.
>> >
>> > http://static.rust-lang.org/doc/master/tutorial.html#boxes
>> >
>> > It's important to note that ~[T] and ~str are not owned boxes. They're
>> just sugar for dynamic arrays, and are common containers.
>> >
>> It's so confusing. If it's not owned box, why not remove ~? Make "str"
>> default be dynamic should OK.
>>
>
> It wouldn't be okay for every string literal to result in a heap
> allocation.
>
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to