On 11/07/2013 11:03 AM, Gaetan wrote:
I mean, the more I use it, the more I tend to use it everywhere, and it seem any "average" user-code (ie, not the rust compiler itself) will have a lot of "~var" anywhere, "let i=~5", ..., more than the other variable initialization. Look at the unit tests for libstd or libextra.
The unit tests are not necessary good code examples. In actual good rust code, you'd almost never need to use a heap allocated ~T if you can use a T on the stack. There is also no problem with that: A ~T behaves almost exactly like a T, the only exceptions being that ~T is always pointer sized, and that ~T always has a destructor, which means it always gets moved around instead of possibly being implicitly copied.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to