mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 892839 - Fix buggy example code in Move.h. r=luke DONTBUILD
This commit is contained in:
parent
6d766118c8
commit
fc156c847f
@ -101,11 +101,11 @@ namespace mozilla {
|
|||||||
* One hint: if you're writing a move constructor where the type has members
|
* 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:
|
* 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:
|
* 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
|
* especially since GNU C++ fails to notice that this does indeed initialize x
|
||||||
* and y, which may matter if they're const.
|
* and y, which may matter if they're const.
|
||||||
|
Loading…
Reference in New Issue
Block a user