25#ifndef FBCPP_VARIANT_TYPE_TRAITS_H
26#define FBCPP_VARIANT_TYPE_TRAITS_H
30#include "StructBinding.h"
32#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
33#include <boost/multiprecision/cpp_int.hpp>
34#include <boost/multiprecision/cpp_dec_float.hpp>
38namespace fbcpp::impl::reflection
44 struct IsSupportedVariantType : std::false_type
50 struct IsSupportedVariantType<bool> : std::true_type
54 struct IsSupportedVariantType<std::int16_t> : std::true_type
58 struct IsSupportedVariantType<std::int32_t> : std::true_type
62 struct IsSupportedVariantType<std::int64_t> : std::true_type
66 struct IsSupportedVariantType<float> : std::true_type
70 struct IsSupportedVariantType<double> : std::true_type
76 struct IsSupportedVariantType<
ScaledInt16> : std::true_type
80 struct IsSupportedVariantType<
ScaledInt32> : std::true_type
84 struct IsSupportedVariantType<
ScaledInt64> : std::true_type
90 struct IsSupportedVariantType<std::string> : std::true_type
96 struct IsSupportedVariantType<
Date> : std::true_type
100 struct IsSupportedVariantType<
Time> : std::true_type
104 struct IsSupportedVariantType<Timestamp> : std::true_type
108 struct IsSupportedVariantType<TimeTz> : std::true_type
112 struct IsSupportedVariantType<TimestampTz> : std::true_type
118 struct IsSupportedVariantType<OpaqueDate> : std::true_type
122 struct IsSupportedVariantType<OpaqueTime> : std::true_type
126 struct IsSupportedVariantType<OpaqueTimestamp> : std::true_type
130 struct IsSupportedVariantType<OpaqueTimeTz> : std::true_type
134 struct IsSupportedVariantType<OpaqueTimestampTz> : std::true_type
140 struct IsSupportedVariantType<BlobId> : std::true_type
144#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
147 struct IsSupportedVariantType<
BoostInt128> : std::true_type
180 struct IsSupportedVariantType<std::monostate> : std::true_type
184 template <
typename T>
185 inline constexpr bool isSupportedVariantTypeV = IsSupportedVariantType<T>::value;
190 template <
typename V, std::
size_t I = 0>
191 struct VariantAlternativesSupported : std::true_type
195 template <
typename V, std::
size_t I>
196 requires(I < std::variant_size_v<V>)
197 struct VariantAlternativesSupported<V, I>
199 using Alt = std::variant_alternative_t<I, V>;
200 static constexpr bool value = isSupportedVariantTypeV<Alt> && VariantAlternativesSupported<V, I + 1>::value;
203 template <
typename V>
204 inline constexpr bool variantAlternativesSupportedV = VariantAlternativesSupported<V>::value;
209namespace fbcpp::impl::reflection
227 struct IsOpaqueType<OpaqueDate> : std::true_type
232 struct IsOpaqueType<OpaqueTime> : std::true_type
237 struct IsOpaqueType<OpaqueTimestamp> : std::true_type
242 struct IsOpaqueType<OpaqueTimeTz> : std::true_type
247 struct IsOpaqueType<OpaqueTimestampTz> : std::true_type
ScaledNumber< OpaqueInt128 > ScaledOpaqueInt128
Scaled Firebird opaque 128-bit integer.
ScaledNumber< std::int64_t > ScaledInt64
Signed 64-bit scaled number.
ScaledNumber< std::int32_t > ScaledInt32
Signed 32-bit scaled number.
boost::multiprecision::number< boost::multiprecision::cpp_dec_float< 34 > > BoostDecFloat34
34-digit decimal floating point using Boost.Multiprecision.
FB_DEC16 OpaqueDecFloat16
Opaque 16-digit decimal floating point exposed by the Firebird API.
ScaledNumber< std::int16_t > ScaledInt16
Signed 16-bit scaled number.
boost::multiprecision::number< boost::multiprecision::cpp_dec_float< 16 > > BoostDecFloat16
16-digit decimal floating point using Boost.Multiprecision.
std::chrono::year_month_day Date
Firebird SQL calendar date.
FB_DEC34 OpaqueDecFloat34
Opaque 34-digit decimal floating point exposed by the Firebird API.
boost::multiprecision::int128_t BoostInt128
128-bit integer using Boost.Multiprecision.
ScaledNumber< BoostInt128 > ScaledBoostInt128
Scaled 128-bit integer backed by Boost.Multiprecision.
std::chrono::hh_mm_ss< std::chrono::microseconds > Time
Firebird SQL time-of-day with microsecond resolution.