diff --git a/src/rttr/detail/conversion/number_conversion.h b/src/rttr/detail/conversion/number_conversion.h index ac40c63b..24de7950 100644 --- a/src/rttr/detail/conversion/number_conversion.h +++ b/src/rttr/detail/conversion/number_conversion.h @@ -134,9 +134,9 @@ typename std::enable_if::value && bool>::type convert_to(const F& from, T& to) { - if (from > std::numeric_limits::max()) + if (from > static_cast(std::numeric_limits::max())) return false; // value too large - else if (from < -std::numeric_limits::max()) + else if (from < static_cast(-std::numeric_limits::max())) return false; // value to small to = static_cast(from); @@ -151,7 +151,7 @@ typename std::enable_if::value && bool>::type convert_to(const F& from, T& to) { - if (from < 0 || from > std::numeric_limits::max()) + if (from < 0 || from > static_cast(std::numeric_limits::max())) return false; // value too large to = static_cast(from);