session and insert query builder progress
This commit is contained in:
@@ -198,16 +198,16 @@ private:
|
||||
template <typename Target, typename Source>
|
||||
bool in_range(Source value) {
|
||||
if constexpr (std::is_signed_v<Source> == std::is_signed_v<Target>) {
|
||||
return value >= static_cast<Target>(std::numeric_limits<Source>::min()) &&
|
||||
value <= static_cast<Target>(std::numeric_limits<Source>::max());
|
||||
return value >= static_cast<Target>((std::numeric_limits<Source>::min)()) &&
|
||||
value <= static_cast<Target>((std::numeric_limits<Source>::max)());
|
||||
} else if constexpr (std::is_signed_v<Source> && !std::is_signed_v<Target>) {
|
||||
if (value < 0) {
|
||||
return false;
|
||||
}
|
||||
using UnsignedSource = std::make_unsigned_t<Source>;
|
||||
return static_cast<UnsignedSource>(value) <= std::numeric_limits<Target>::max();
|
||||
return static_cast<UnsignedSource>(value) <= (std::numeric_limits<Target>::max)();
|
||||
} else {
|
||||
return value <= static_cast<std::make_unsigned_t<Target>>(std::numeric_limits<Target>::max());
|
||||
return value <= static_cast<std::make_unsigned_t<Target>>((std::numeric_limits<Target>::max)());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user