diff options
-rw-r--r-- | libadhocutil/c++11Helpers.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libadhocutil/c++11Helpers.h b/libadhocutil/c++11Helpers.h index e34fcf8..9826189 100644 --- a/libadhocutil/c++11Helpers.h +++ b/libadhocutil/c++11Helpers.h @@ -10,9 +10,16 @@ #define SPECIAL_MEMBERS_MOVE(T, type) \ T(T &&) noexcept = type; \ T & operator=(T &&) noexcept = type +#define SPECIAL_MEMBERS_MOVE_RO(T) \ + T(const T &) = delete; \ + T(T &&) noexcept = default; \ + SPECIAL_MEMBERS_ASSIGN(T, delete) #define SPECIAL_MEMBERS_COPY(T, type) \ T(const T &) = type; \ T & operator=(const T &) = type +#define SPECIAL_MEMBERS_COPY_RO(T) \ + SPECIAL_MEMBERS_CONS(T, default); \ + SPECIAL_MEMBERS_ASSIGN(T, delete) #define SPECIAL_MEMBERS_DEFAULT(T) \ SPECIAL_MEMBERS_COPY(T, default); \ SPECIAL_MEMBERS_MOVE(T, default) |