Don't worry, our pointers _are_ more confusing compared to many other languages after all. :) Am 07.11.2013 11:25 schrieb "Marvin Löbel" <loebel.mar...@gmail.com>:
> 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 Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev