aboutsummaryrefslogtreecommitdiff
path: root/store/works/life/cpp-practicum/Base.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'store/works/life/cpp-practicum/Base.hpp')
-rw-r--r--store/works/life/cpp-practicum/Base.hpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/store/works/life/cpp-practicum/Base.hpp b/store/works/life/cpp-practicum/Base.hpp
new file mode 100644
index 0000000..44a9d6c
--- /dev/null
+++ b/store/works/life/cpp-practicum/Base.hpp
@@ -0,0 +1,25 @@
+#pragma once
+
+#include <exception>
+#include <stdexcept>
+
+#define CRU_DEFAULT_COPY(classname) \
+ classname(const classname &) = default; \
+ classname &operator=(const classname &) = default;
+
+#define CRU_DEFAULT_MOVE(classname) \
+ classname(classname &&) = default; \
+ classname &operator=(classname &&) = default;
+
+#define CRU_DELETE_COPY(classname) \
+ classname(const classname &) = delete; \
+ classname &operator=(const classname &) = delete;
+
+#define CRU_DELETE_MOVE(classname) \
+ classname(classname &&) = delete; \
+ classname &operator=(classname &&) = delete;
+
+class SerializationException : public std::runtime_error {
+public:
+ using runtime_error::runtime_error;
+};