On 08/13/2014 07:44 AM, Ehsan Akhgari wrote: > If that is the goal, then I don't agree that is a useful outcome at all. I > *do* wish that there were better *and* safer ways of doing more things > automatically but ownership transfers are inherently unsafe operations that > are expressed using various different kinds of conventions in C++ > (already_AddRefed being one such convention.) In my experience, when > people are not aware of how they're transferring ownership, bugs creep in.
The very point of move semantics is that they're built into the fabric of the language, and you can't evade them except with casts (including through explicit use of Move(), which is sufficiently explicit as to even be acceptable). Having ownership transfers take advantage of this makes them inherently safer. If a mistake is made (by ignoring a return value or similar), the consequence is usually an extra addref/release, not a leak. I lack sufficient knowledge/experience with Rust to speak too forcefully about it. But it's worth emphasizing that, by my understanding, every value in Rust is passed using move semantics. (And you need something like reference counting tacked on to evade that.) That speaks volumes for the safety of move semantics, in my mind. Jeff _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform