File tree Expand file tree Collapse file tree
include/boost/safe_numbers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ BOOST_SAFE_NUMBERS_EXPORT constexpr auto operator ""_i128(const char* str) -> i1
143143
144144BOOST_SAFE_NUMBERS_EXPORT constexpr auto operator " " _f32(const long double val) -> f32
145145{
146- if (constexpr long double max_value {std::numeric_limits<float >::max ()}; val > max_value)
146+ if (constexpr auto max_value {static_cast < long double >( std::numeric_limits<float >::max () )}; val > max_value)
147147 {
148148 BOOST_SAFE_NUMBERS_THROW_EXCEPTION (std::overflow_error, " Overflow detected in literal construction" );
149149 }
@@ -153,7 +153,7 @@ BOOST_SAFE_NUMBERS_EXPORT constexpr auto operator ""_f32(const long double val)
153153
154154BOOST_SAFE_NUMBERS_EXPORT constexpr auto operator " " _f64(const long double val) -> f64
155155{
156- if (constexpr long double max_value {std::numeric_limits<double >::max ()}; val > max_value)
156+ if (constexpr auto max_value {static_cast < long double >( std::numeric_limits<double >::max () )}; val > max_value)
157157 {
158158 BOOST_SAFE_NUMBERS_THROW_EXCEPTION (std::overflow_error, " Overflow detected in literal construction" );
159159 }
You can’t perform that action at this time.
0 commit comments