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>
37#if FB_CPP_USE_BOOST_DECIMAL != 0
38#include <boost/decimal.hpp>
42namespace fbcpp::impl::reflection
48 struct IsSupportedVariantType : std::false_type
54 struct IsSupportedVariantType<bool> : std::true_type
58 struct IsSupportedVariantType<std::int16_t> : std::true_type
62 struct IsSupportedVariantType<std::int32_t> : std::true_type
66 struct IsSupportedVariantType<std::int64_t> : std::true_type
70 struct IsSupportedVariantType<float> : std::true_type
74 struct IsSupportedVariantType<double> : std::true_type
80 struct IsSupportedVariantType<
ScaledInt16> : std::true_type
84 struct IsSupportedVariantType<
ScaledInt32> : std::true_type
88 struct IsSupportedVariantType<
ScaledInt64> : std::true_type
94 struct IsSupportedVariantType<std::string> : std::true_type
100 struct IsSupportedVariantType<
Date> : std::true_type
104 struct IsSupportedVariantType<
Time> : std::true_type
108 struct IsSupportedVariantType<Timestamp> : std::true_type
112 struct IsSupportedVariantType<TimeTz> : std::true_type
116 struct IsSupportedVariantType<TimestampTz> : std::true_type
122 struct IsSupportedVariantType<OpaqueDate> : std::true_type
126 struct IsSupportedVariantType<OpaqueTime> : std::true_type
130 struct IsSupportedVariantType<OpaqueTimestamp> : std::true_type
134 struct IsSupportedVariantType<OpaqueTimeTz> : std::true_type
138 struct IsSupportedVariantType<OpaqueTimestampTz> : std::true_type
144 struct IsSupportedVariantType<BlobId> : std::true_type
148#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
151 struct IsSupportedVariantType<
BoostInt128> : std::true_type
168#if FB_CPP_USE_BOOST_DECIMAL != 0
200 struct IsSupportedVariantType<std::monostate> : std::true_type
204 template <
typename T>
205 inline constexpr bool isSupportedVariantTypeV = IsSupportedVariantType<T>::value;
210 template <
typename V, std::
size_t I = 0>
211 struct VariantAlternativesSupported : std::true_type
215 template <
typename V, std::
size_t I>
216 requires(I < std::variant_size_v<V>)
217 struct VariantAlternativesSupported<V, I>
219 using Alt = std::variant_alternative_t<I, V>;
220 static constexpr bool value = isSupportedVariantTypeV<Alt> && VariantAlternativesSupported<V, I + 1>::value;
223 template <
typename V>
224 inline constexpr bool variantAlternativesSupportedV = VariantAlternativesSupported<V>::value;
229namespace fbcpp::impl::reflection
247 struct IsOpaqueType<OpaqueDate> : std::true_type
252 struct IsOpaqueType<OpaqueTime> : std::true_type
257 struct IsOpaqueType<OpaqueTimestamp> : std::true_type
262 struct IsOpaqueType<OpaqueTimeTz> : std::true_type
267 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.
boost::decimal::decimal128_t BoostDecimal128
34-digit decimal floating point using Boost.Decimal.
boost::decimal::decimal32_t BoostDecimal32
7-digit decimal floating point using Boost.Decimal.
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.
boost::decimal::decimal64_t BoostDecimal64
16-digit decimal floating point using Boost.Decimal.
std::chrono::hh_mm_ss< std::chrono::microseconds > Time
Firebird SQL time-of-day with microsecond resolution.