In the french presentation for rust 0.8 [1], the author gives the analogy
with C++ semantics
- ~ is a bit like unique_ptr
- @ is an enhanced shared_ptr<T>
- borrowed pointer works like C++ reference

and I think it was very helpful to better understand them. I don't know if
it is true or now, but this comparison helps a lot understanding the
concepts.You can present them like this, and after, add more precision, and
difference with the C++ counter parts.

A tutorial to make would be "Rust for C++ programmer" :)


[1] http://linuxfr.org/news/presentation-de-rust-0-8

-----
Gaetan



2013/11/19 Daniel Micay <[email protected]>

> On Tue, Nov 19, 2013 at 4:25 AM, Gaetan <[email protected]> wrote:
> > I don't think there is any particular issue with the tutorial, but we
> need
> > more "recipes" on how to handle typical situations.
>
> I'm specifically talking about the `Boxes` section in the tutorial and
> not the whole picture. I keep hearing that the coverage of `~` it's
> confusing - so can someone elaborate?
>
> Rewriting the coverage of boxes and references by walking through the
> implementation of some data structures is something I'm willing to do,
> but in my opinion that section is now quite good, other than being dry
> and not presenting interesting code samples for the use cases it
> describes.
>
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to