On Wed, Mar 5, 2014 at 6:22 AM, Michael Neumann <mneum...@ntecs.de> wrote:
> Try the same in C++:
>
>
>     auto i = make_unique<int>(1234);
>     auto j = std::move(i);
>     cout << *j << endl; // 1234
>     cout << *i << endl; // Segmentation Fault

Note that a move out of unique_ptr is guaranteed to leave the original
null, so while this is not detected at compile time, it's also not
memory-unsafe.
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to