From d1fe6779777578cec8010707699403fc470f09d6 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 23 Jan 2017 21:48:12 +1100 Subject: [PATCH] cast: use is_nan to avoid integer warnings --- cast.hpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cast.hpp b/cast.hpp index f2a959ab..6afc863b 100644 --- a/cast.hpp +++ b/cast.hpp @@ -88,10 +88,7 @@ trunc_cast (const SrcT src) { auto dst = static_cast (src); - // check if we're testing a NaN by using self-equality. this will not hold - // for NaN, but makes specialisation easier given we don't need to special - // case for integers (which don't have std::isnan). - if (src == src) { + if (!util::is_nan (src)) { CHECK_EQ (static_cast (dst), src); } else { CHECK_NEQ (dst, dst);