DISALLOW_COPY_AND_ASSIGN macro now uses the delete keyword and allows move assignment and construction

Change-Id: Ibb19cdb4343e0d7ddaa073cff5373ec24f24a2d3
This commit is contained in:
Tyler Veness
2015-06-24 00:51:46 -07:00
parent 7a711a21f9
commit 045a9b32db
2 changed files with 12 additions and 10 deletions

View File

@@ -7,11 +7,12 @@
#include "HAL/Semaphore.hpp"
// A macro to disallow the copy constructor and operator= functions
// This should be used in the private: declarations for a class
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&); \
void operator=(const TypeName&)
// A macro for making a class move-only
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&) = delete; \
TypeName& operator=(const TypeName&) = delete; \
TypeName(TypeName&&) = default; \
TypeName& operator=(TypeName&&) = default
#define CRITICAL_REGION(s) { Synchronized _sync(s);
#define END_REGION }