diff options
Diffstat (limited to 'lib/special_members.hpp')
-rw-r--r-- | lib/special_members.hpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/special_members.hpp b/lib/special_members.hpp index 0d63f58..d1dca99 100644 --- a/lib/special_members.hpp +++ b/lib/special_members.hpp @@ -9,10 +9,20 @@ TYPE(TYPE &&) = delete; \ void operator=(TYPE &&) = delete -#define DEFAULT_MOVE_COPY(TYPE) \ +#define DEFAULT_MOVE(TYPE) \ + TYPE(TYPE &&) noexcept = default; \ + TYPE & operator=(TYPE &&) noexcept = default + +#define DEFAULT_COPY(TYPE) \ TYPE(const TYPE &) = default; \ - TYPE(TYPE &&) = default; \ - TYPE & operator=(const TYPE &) = default; \ - TYPE & operator=(TYPE &&) = default + TYPE & operator=(const TYPE &) = default + +#define DEFAULT_MOVE_COPY(TYPE) \ + DEFAULT_MOVE(TYPE); \ + DEFAULT_COPY(TYPE) + +#define DEFAULT_MOVE_NO_COPY(TYPE) \ + DEFAULT_MOVE(TYPE); \ + NO_COPY(TYPE) #endif |