This commit is contained in:
Christian Zimmermann 2022-09-03 22:11:36 +02:00
parent 05f4cb0abb
commit 5d473ddd8c
4 changed files with 17 additions and 14 deletions

View file

@ -24,16 +24,15 @@
#endif #endif
#define DEFAULT_MEMBERS(__class_name__) __class_name__() = default; \ #define DEFAULT_C(__class_name__) __class_name__() = default
__class_name__(const __class_name__& in) = default; \ #define DEFAULT_COPY_C(__class_name__) __class_name__(const __class_name__& a) = default
__class_name__& operator=(const __class_name__& in) = default; \ #define DEFAULT_COPY_A(__class_name__) __class_name__& operator=(const __class_name__& a) = default
__class_name__(__class_name__&& in) = default; \ #define DEFAULT_MOVE_C(__class_name__) __class_name__(__class_name__&& a) = default
__class_name__& operator=(__class_name__&& in) = 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_MEMBERS_X(__class_name__) __class_name__(const __class_name__& in) = default; \ #define DEFAULT_MOVE(__class_name__) DEFAULT_MOVE_C(__class_name__); DEFAULT_MOVE_A(__class_name__)
__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__) DEFAULT_COPY(__class_name__); DEFAULT_MOVE(__class_name__)
#define DEFAULT_MEMBERS(__class_name__) DEFAULT_C(__class_name__); DEFAULT_MEMBERS_X(__class_name__)
#endif #endif

View file

@ -4,8 +4,10 @@
#include <cstdlib> #include <cstdlib>
#include <utility> #include <utility>
#include <memory>
#include "allocator.h" #include "allocator.h"
#include "rbase_def.h"
namespace CNORXZ namespace CNORXZ
{ {
@ -143,8 +145,8 @@ namespace CNORXZ
const std::vector<T>* mD; const std::vector<T>* mD;
public: public:
TypeWrapper(const std::vector<T>* d) : mD(d) {} TypeRefWrapper(const std::vector<T>* d) : mD(d) {}
DEFAULT_MEMBERS(TypeWrapper); DEFAULT_MEMBERS(TypeRefWrapper);
virtual std::string str() const { return to_string(*mD); /* overload before!!! */ } virtual std::string str() const { return to_string(*mD); /* overload before!!! */ }
virtual bool operator==(const DType& in) const { return this->str() == in.str(); } virtual bool operator==(const DType& in) const { return this->str() == in.str(); }

View file

@ -100,8 +100,8 @@ namespace CNORXZ
return iptr; return iptr;
} }
template <class Index> template <class Index, typename MetaType>
using IndexPtr = std::shared_ptr<IndexInterface<Index>> using IndexPtr = std::shared_ptr<IndexInterface<Index,MetaType>>;
} }

View file

@ -14,6 +14,8 @@
<< " in " << __func__ << ": " << #a << " = " << a << std::endl; << " in " << __func__ << ": " << #a << " = " << a << std::endl;
#endif #endif
#include "base_def.h"
#include "allocator.h" #include "allocator.h"
#define MUI static_cast<size_t>(-1) #define MUI static_cast<size_t>(-1)