28 #include <type_traits>
31 #include <string_view>
35 static_assert(!std::is_trivial<std::string_view>::value);
52 static_assert(
sizeof(
char) ==
sizeof(int8_t));
53 static_assert(std::is_standard_layout<StringView>::value);
54 static_assert(std::is_trivial<StringView>::value);
68 static_assert(!std::is_standard_layout<VarlenDatum>::value);
69 static_assert(!std::is_trivial<VarlenDatum>::value);
87 static_assert(std::is_same_v<T, bool> || std::is_same_v<T, int8_t> ||
88 std::is_same_v<T, int16_t> || std::is_same_v<T, int32_t> ||
89 std::is_same_v<T, int64_t> || std::is_same_v<T, float> ||
90 std::is_same_v<T, double> || std::is_same_v<T, VarlenDatum*>
92 || std::is_same_v<T, std::string*>
95 "Type T must be one of the allowed types");
97 if constexpr (std::is_same_v<T, bool>) {
98 d.
boolval =
static_cast<int8_t
>(val);
99 }
else if constexpr (std::is_same_v<T, int8_t>) {
101 }
else if constexpr (std::is_same_v<T, int16_t>) {
103 }
else if constexpr (std::is_same_v<T, int32_t>) {
105 }
else if constexpr (std::is_same_v<T, int64_t>) {
107 }
else if constexpr (std::is_same_v<T, float>) {
109 }
else if constexpr (std::is_same_v<T, double>) {
111 }
else if constexpr (std::is_same_v<T, VarlenDatum*>) {
115 }
else if constexpr (std::is_same_v<T, std::string*>) {
VarlenDatum(const size_t l, int8_t *p, const bool n)
std::string_view stringView() const
bool g_enable_smem_group_by true
virtual DEVICE ~VarlenDatum()