From 42701cc2fcdff6482ab132cce57f0fdde04dcaee Mon Sep 17 00:00:00 2001 From: Qianqian Fang Date: Fri, 18 Feb 2022 15:32:30 -0500 Subject: [PATCH] gcc warn useless conversion but msvc gives an error --- include/nlohmann/detail/input/binary_reader.hpp | 2 +- single_include/nlohmann/json.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/nlohmann/detail/input/binary_reader.hpp b/include/nlohmann/detail/input/binary_reader.hpp index c070859c6..e938e42c5 100644 --- a/include/nlohmann/detail/input/binary_reader.hpp +++ b/include/nlohmann/detail/input/binary_reader.hpp @@ -2072,7 +2072,7 @@ class binary_reader { return false; } - result = number; + result = static_cast(number); return true; } case '[': diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 697f26745..80e367588 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -10448,7 +10448,7 @@ class binary_reader { return false; } - result = number; + result = static_cast(number); return true; } case '[':