diff --git a/server/table.h b/server/table.h index 5727ddc..af26ae7 100644 --- a/server/table.h +++ b/server/table.h @@ -720,51 +720,56 @@ inline void TableInfo::print(const char* __restrict sep, const char* _ std::cout << end; } } + +// use std::is_base_of here and all vt classes should derive from vector_base template class VT, class TRet> -using test_vt_support = typename std::enable_if_t, ColRef> || - std::is_same_v, ColView> || - std::is_same_v, vector_type>, TRet>; +using test_vt_support = typename std::enable_if_t< + std::is_base_of_v, VT>, + TRet>; -template class VT> -using get_autoext_type = test_vt_support::type>>; -template class VT> -using get_long_type = test_vt_support::type>>>; +template class VT, + test_vt_support* = nullptr> +using get_autoext_type = + decayed_t::type>; -template class VT> -using get_fp_type = test_vt_support::type>>>; +template class VT, + test_vt_support* = nullptr> +using get_long_type = + decayed_t::type>>; + +template class VT, + test_vt_support* = nullptr> +using get_fp_type = + decayed_t::type>>; template class VT, template class VT2, class TRet> -using test_vt_support2 = typename std::enable_if_t<(std::is_same_v, ColRef> || - std::is_same_v, ColView> || - std::is_same_v, vector_type>) && - (std::is_same_v, ColRef> || - std::is_same_v, ColView> || - std::is_same_v, vector_type>), TRet >; +using test_vt_support2 = typename std::enable_if_t< + std::is_base_of_v, VT> && + std::is_base_of_v, VT2>, + TRet >; + template class VT, template class VT2> -using get_autoext_type2 = test_vt_support2::type>>; + template class VT, template class VT2, + test_vt_support2* = nullptr > +using get_autoext_type2 = + decayed_t::type>; template class VT, template class VT2> -using get_long_type2 = test_vt_support2::type>>>; + template class VT, template class VT2, + test_vt_support2* = nullptr > +using get_long_type2 = + decayed_t::type>>; template class VT, template class VT2> -using get_fp_type2 = test_vt_support2::type>>>; + template class VT, template class VT2, + test_vt_support2* = nullptr > +using get_fp_type2 = + decayed_t::type>>; template class VT, template class VT2> get_autoext_type2 diff --git a/server/vector_type.hpp b/server/vector_type.hpp index ceb62e3..f817051 100644 --- a/server/vector_type.hpp +++ b/server/vector_type.hpp @@ -19,6 +19,7 @@ #pragma pack(push, 1) template struct vector_base {}; + struct vectortype_cstorage{ void* container; unsigned int size, capacity;