From bacaf34409a6df3d96661d654022b572c0f56fc1 Mon Sep 17 00:00:00 2001 From: Andrey Davydov Date: Tue, 7 Jan 2020 16:46:50 +0300 Subject: [PATCH] fix clang warning 'implicit-int-float-conversion' --- src/rttr/detail/conversion/number_conversion.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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);