summaryrefslogtreecommitdiffhomepage
path: root/compat/defs.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-21 14:20:16 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-21 14:20:16 +0200
commit7a38c6c434e03256d9e9fbff87516b3ad1e3958a (patch)
tree2cb34a9613fc7f50a6bd7dc0d03eca448e3f5567 /compat/defs.hpp
parent9a0d8a428b21a77272380009d97436b0a5f20d8c (diff)
macro shenanigans
Diffstat (limited to 'compat/defs.hpp')
-rw-r--r--compat/defs.hpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/compat/defs.hpp b/compat/defs.hpp
index 632bafe5..1bd0f181 100644
--- a/compat/defs.hpp
+++ b/compat/defs.hpp
@@ -1,19 +1,33 @@
#pragma once
#ifdef _MSC_VER
-# define FUNCTION_NAME __FUNCSIG__
+# define fm_FUNCTION_NAME __FUNCSIG__
#else
-# define FUNCTION_NAME __PRETTY_FUNCTION__
+# define fm_FUNCTION_NAME __PRETTY_FUNCTION__
#endif
-#define progn(...) [&]{__VA_ARGS__;}()
+#define fm_begin(...) [&]{__VA_ARGS__}()
-#define DECLARE_DEPRECATED_COPY_ASSIGNMENT(type) \
- [[deprecated]] type(const type&) = default; \
- [[deprecated]] type& operator=(const type&) = default
+#define fm_DECLARE_DEPRECATED_COPY_ASSIGNMENT(type) \
+ [[deprecated]] type(const type&) noexcept = default; \
+ [[deprecated]] type& operator=(const type&) noexcept = default
-#define DECLARE_DELETED_COPY_ASSIGNMENT(type) \
- type(const type&) = delete; \
+#define fm_DECLARE_DEFAULT_COPY_ASSIGNMENT(type) \
+ constexpr type(const type&) noexcept = default; \
+ constexpr type& operator=(const type&) noexcept = default
+
+#define fm_DECLARE_DELETED_COPY_ASSIGNMENT(type) \
+ type(const type&) = delete; \
type& operator=(const type&) = delete
+#define fm_DECLARE_DELETED_MOVE_ASSIGNMENT(type) \
+ [[deprecated]] type(type&&) = delete; \
+ [[deprecated]] type& operator=(type&&) = delete
+
+#define fm_DECLARE_DEFAULT_MOVE_ASSIGNMENT(type) \
+ constexpr type(type&&) noexcept = default; \
+ constexpr type& operator=(type&&) noexcept = default
+#define fm_DECLARE_DEFAULT_MOVE_COPY_ASSIGNMENTS(type) \
+ fm_DECLARE_DEFAULT_MOVE_ASSIGNMENT(type); \
+ fm_DECLARE_DEFAULT_COPY_ASSIGNMENT(type)