summaryrefslogtreecommitdiff
path: root/lib/special_members.hpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-02-28 15:42:39 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-02-28 15:42:39 +0000
commitd63f5ce1cb86e69da28bd74b21e9452dbd88a38f (patch)
tree0c9495f8cb5af05e6068b69d5d57551cc2331a97 /lib/special_members.hpp
parentJust use addLinksBetween (diff)
downloadilt-d63f5ce1cb86e69da28bd74b21e9452dbd88a38f.tar.bz2
ilt-d63f5ce1cb86e69da28bd74b21e9452dbd88a38f.tar.xz
ilt-d63f5ce1cb86e69da28bd74b21e9452dbd88a38f.zip
Move utility to lib
Diffstat (limited to 'lib/special_members.hpp')
-rw-r--r--lib/special_members.hpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/special_members.hpp b/lib/special_members.hpp
new file mode 100644
index 0000000..0d63f58
--- /dev/null
+++ b/lib/special_members.hpp
@@ -0,0 +1,18 @@
+#ifndef SPECIAL_MEMBERS_H
+#define SPECIAL_MEMBERS_H
+
+#define NO_COPY(TYPE) \
+ TYPE(const TYPE &) = delete; \
+ void operator=(const TYPE &) = delete
+
+#define NO_MOVE(TYPE) \
+ TYPE(TYPE &&) = delete; \
+ void operator=(TYPE &&) = delete
+
+#define DEFAULT_MOVE_COPY(TYPE) \
+ TYPE(const TYPE &) = default; \
+ TYPE(TYPE &&) = default; \
+ TYPE & operator=(const TYPE &) = default; \
+ TYPE & operator=(TYPE &&) = default
+
+#endif