Bug 892839 - Fix buggy example code in Move.h. r=luke DONTBUILD

This commit is contained in:
Justin Lebar 2013-07-15 10:40:30 -07:00
parent 6d766118c8
commit fc156c847f

View File

@ -101,11 +101,11 @@ namespace mozilla {
* One hint: if you're writing a move constructor where the type has members
* that should be moved themselves, it's much nicer to write this:
*
* C(MoveRef<C> c) : x(c->x), y(c->y) { }
* C(MoveRef<C> c) : x(Move(c->x)), y(Move(c->y)) { }
*
* than the equivalent:
*
* C(MoveRef<C> c) { new(&x) X(c->x); new(&y) Y(c->y); }
* C(MoveRef<C> c) { new(&x) X(Move(c->x)); new(&y) Y(Move(c->y)); }
*
* especially since GNU C++ fails to notice that this does indeed initialize x
* and y, which may matter if they're const.