@@ -235,7 +235,7 @@ template<typename SRC,typename DST,
235235 typename details::EnableIf< details::unsigned_to_smaller_conversion<SRC, DST>>* = nullptr >
236236inline void convert_impl ( const SRC& from, DST& target )
237237{
238- if (!std::isnan (from)) {
238+ if (!std::isnan (static_cast < double >( from) )) {
239239 checkUpperLimit<SRC,DST>(from);
240240 }
241241 target = static_cast <DST>(from);
@@ -245,7 +245,7 @@ template<typename SRC,typename DST,
245245 typename details::EnableIf< details::signed_to_smaller_conversion<SRC, DST>>* = nullptr >
246246inline void convert_impl ( const SRC& from, DST& target )
247247{
248- if (!std::isnan (from)) {
248+ if (!std::isnan (static_cast < double >( from) )) {
249249 checkLowerLimit<SRC,DST>(from);
250250 checkUpperLimit<SRC,DST>(from);
251251 }
@@ -257,7 +257,7 @@ template<typename SRC,typename DST,
257257 typename details::EnableIf< details::signed_to_smaller_unsigned_conversion<SRC, DST>>* = nullptr >
258258inline void convert_impl ( const SRC& from, DST& target )
259259{
260- if (!std::isnan (from) && from < 0 ){
260+ if (!std::isnan (static_cast < double >( from) ) && from < 0 ){
261261 throw RangeException (" Value is negative and can't be converted to signed" );
262262 }
263263
@@ -332,7 +332,7 @@ template<typename SRC,typename DST,
332332 typename details::EnableIf< details::integer_to_floating_conversion<SRC, DST>>* = nullptr >
333333inline void convert_impl ( const SRC& from, DST& target )
334334{
335- if (!std::isnan (from)) {
335+ if (!std::isnan (static_cast < double >( from) )) {
336336 checkTruncation<SRC,DST>(from);
337337 }
338338 target = static_cast <DST>( from);
0 commit comments