From 94b7f599da422eeb2445b16ead26c618c59af127 Mon Sep 17 00:00:00 2001 From: tt4g Date: Tue, 12 Feb 2019 09:42:45 +0900 Subject: [PATCH] Suppress warning C4127 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; \