small changes in log_manager.cpp and add is_database_primitive type traits and test

This commit is contained in:
Sascha Kühl
2026-02-05 16:36:27 +01:00
parent 018e27a22a
commit c0e0499204
6 changed files with 83 additions and 10 deletions
+17
View File
@@ -46,6 +46,23 @@ struct time_type_t {
uint32_t microsecond{};
};
namespace detail {
template <typename T, typename Variant>
struct is_in_variant;
template <typename T, typename... Alts>
struct is_in_variant<T, std::variant<Alts...>>
: std::bool_constant<(std::is_same_v<T, Alts> || ...)> {
};
}
template<typename T>
struct is_database_primitive : detail::is_in_variant<std::remove_cv_t<std::remove_reference_t<T>>, database_type> {
};
template <typename T>
inline constexpr bool is_database_primitive_v = is_database_primitive<T>::value;
void initialize_by_basic_type(basic_type type, database_type &val);