On Fri, Apr 29, 2016 at 4:43 PM, Gerald Squelart <squel...@gmail.com> wrote:
> For example, we know how strings behave when moved from* (the original > becomes empty), and it'd be nice to be able to use that trick when possible > and really needed. > No, we don't know that. The contract of a move in C++ is simply that the source object is safe to destruct, but otherwise in an undefined state. You must not make any assumptions about its value. It is not always the case that the fastest move implementation leaves the source empty. For example, if the string is using inline storage, then a move would need to take extra steps to clear the original. You write about "us[ing] that trick when possible and really needed", when what you're actually saying is "let's depend on undefined behavior." That approach is common, and its history is not pretty. _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform