diff options
-rw-r--r-- | src/mongo/base/disallow_copying.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/base/disallow_copying.h b/src/mongo/base/disallow_copying.h index 2e774e4871b..9a3b68903ea 100644 --- a/src/mongo/base/disallow_copying.h +++ b/src/mongo/base/disallow_copying.h @@ -32,6 +32,9 @@ * for class "CLASS". Must be the _first_ or _last_ line of the class declaration. Prefer * to use it as the first line. * + * If you use this macro and wish to make the class movable, you must define the move assignment + * operator and move constructor. + * * Usage: * class Foo { * MONGO_DISALLOW_COPYING(Foo); @@ -39,7 +42,6 @@ * ... * }; */ -#define MONGO_DISALLOW_COPYING(CLASS) \ - private: \ - CLASS(const CLASS&); \ - CLASS& operator=(const CLASS&) +#define MONGO_DISALLOW_COPYING(CLASS) \ + CLASS(const CLASS&) = delete; \ + CLASS& operator=(const CLASS&) = delete |