From 5d473ddd8c84701f5451f730e5b6953baa166e25 Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Sat, 3 Sep 2022 22:11:36 +0200 Subject: [PATCH] wip... --- src/include/base_def.h | 19 +++++++++---------- src/include/ranges/dynamic_meta.h | 6 ++++-- src/include/ranges/index_base.h | 4 ++-- src/include/ranges/rbase_def.h | 2 ++ 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/include/base_def.h b/src/include/base_def.h index d5d87da..79c38aa 100644 --- a/src/include/base_def.h +++ b/src/include/base_def.h @@ -24,16 +24,15 @@ #endif -#define DEFAULT_MEMBERS(__class_name__) __class_name__() = default; \ - __class_name__(const __class_name__& in) = default; \ - __class_name__& operator=(const __class_name__& in) = default; \ - __class_name__(__class_name__&& in) = default; \ - __class_name__& operator=(__class_name__&& in) = default - -#define DEFAULT_MEMBERS_X(__class_name__) __class_name__(const __class_name__& in) = default; \ - __class_name__& operator=(const __class_name__& in) = default; \ - __class_name__(__class_name__&& in) = default; \ - __class_name__& operator=(__class_name__&& in) = default +#define DEFAULT_C(__class_name__) __class_name__() = default +#define DEFAULT_COPY_C(__class_name__) __class_name__(const __class_name__& a) = default +#define DEFAULT_COPY_A(__class_name__) __class_name__& operator=(const __class_name__& a) = default +#define DEFAULT_MOVE_C(__class_name__) __class_name__(__class_name__&& a) = default +#define DEFAULT_MOVE_A(__class_name__) __class_name__& operator=(__class_name__&& a) = default +#define DEFAULT_COPY(__class_name__) DEFAULT_COPY_C(__class_name__); DEFAULT_COPY_A(__class_name__) +#define DEFAULT_MOVE(__class_name__) DEFAULT_MOVE_C(__class_name__); DEFAULT_MOVE_A(__class_name__) +#define DEFAULT_MEMBERS_X(__class_name__) DEFAULT_COPY(__class_name__); DEFAULT_MOVE(__class_name__) +#define DEFAULT_MEMBERS(__class_name__) DEFAULT_C(__class_name__); DEFAULT_MEMBERS_X(__class_name__) #endif diff --git a/src/include/ranges/dynamic_meta.h b/src/include/ranges/dynamic_meta.h index 7e1fb1d..37473fb 100644 --- a/src/include/ranges/dynamic_meta.h +++ b/src/include/ranges/dynamic_meta.h @@ -4,8 +4,10 @@ #include #include +#include #include "allocator.h" +#include "rbase_def.h" namespace CNORXZ { @@ -143,8 +145,8 @@ namespace CNORXZ const std::vector* mD; public: - TypeWrapper(const std::vector* d) : mD(d) {} - DEFAULT_MEMBERS(TypeWrapper); + TypeRefWrapper(const std::vector* d) : mD(d) {} + DEFAULT_MEMBERS(TypeRefWrapper); virtual std::string str() const { return to_string(*mD); /* overload before!!! */ } virtual bool operator==(const DType& in) const { return this->str() == in.str(); } diff --git a/src/include/ranges/index_base.h b/src/include/ranges/index_base.h index e4fdacc..c60e1c4 100644 --- a/src/include/ranges/index_base.h +++ b/src/include/ranges/index_base.h @@ -100,8 +100,8 @@ namespace CNORXZ return iptr; } - template - using IndexPtr = std::shared_ptr> + template + using IndexPtr = std::shared_ptr>; } diff --git a/src/include/ranges/rbase_def.h b/src/include/ranges/rbase_def.h index 57a1943..67cf045 100644 --- a/src/include/ranges/rbase_def.h +++ b/src/include/ranges/rbase_def.h @@ -14,6 +14,8 @@ << " in " << __func__ << ": " << #a << " = " << a << std::endl; #endif +#include "base_def.h" + #include "allocator.h" #define MUI static_cast(-1)