From 283d06f9f796e779ac94b769dbd13f3a9786c305 Mon Sep 17 00:00:00 2001 From: tt4g <45120617+tt4g@users.noreply.github.com> Date: Thu, 14 Feb 2019 00:39:59 +0900 Subject: [PATCH] Fix warning C4127 on Visual Studio (#672) Splitting the condition of the if statement containing `constant expression` eliminates warnings in Visual Studio with /W4. --- include/yaml-cpp/node/convert.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/yaml-cpp/node/convert.h b/include/yaml-cpp/node/convert.h index b8210c7..d61b73d 100644 --- a/include/yaml-cpp/node/convert.h +++ b/include/yaml-cpp/node/convert.h @@ -116,10 +116,11 @@ struct convert<_Null> { } \ } \ \ - if (std::numeric_limits::has_quiet_NaN && \ - conversion::IsNaN(input)) { \ - rhs = std::numeric_limits::quiet_NaN(); \ - return true; \ + if (std::numeric_limits::has_quiet_NaN) { \ + if (conversion::IsNaN(input)) { \ + rhs = std::numeric_limits::quiet_NaN(); \ + return true; \ + } \ } \ \ return false; \