fixed issue for user module

This commit is contained in:
2022-10-23 05:47:53 +08:00
parent d5382c36e9
commit 5549706443
10 changed files with 92 additions and 59 deletions
+16 -1
View File
@@ -74,7 +74,7 @@ public:
this->container = (_Ty*)container;
this->name = name;
}
template<template <typename ...> class VT, typename T>
template<template <typename> class VT, typename T>
void initfrom(const VT<T>& v, const char* name = "") {
ty = types::Types<_Ty>::getType();
this->size = v.size;
@@ -82,6 +82,21 @@ public:
this->container = (_Ty*)(v.container);
this->name = name;
}
void initfrom(vectortype_cstorage v, const char* name = "") {
ty = types::Types<_Ty>::getType();
this->size = v.size;
this->capacity = v.capacity;
this->container = (_Ty*)v.container;
this->name = name;
}
template<typename T>
void initfrom(const T& v, const char* name = "") {
ty = types::Types<_Ty>::getType();
this->size = 0;
this->capacity = 0;
this->emplace_back(v);
this->name = name;
}
template <class T>
ColRef<_Ty>& operator =(ColRef<T>&& vt) {
this->container = (_Ty*)vt.container;
+3
View File
@@ -77,6 +77,9 @@ public:
constexpr vector_type(vector_type<_Ty>&& vt) noexcept : capacity(0) {
_move(std::move(vt));
}
vector_type(vectortype_cstorage vt) noexcept : capacity(vt.capacity), size(vt.size), container((_Ty*)vt.container) {
out(10);
};
// size >= capacity ==> readonly vector
constexpr vector_type(const uint32_t size, void* data) :
size(size), capacity(0), container(static_cast<_Ty*>(data)) {}