diff --git a/include/nlohmann/detail/meta/type_traits.hpp b/include/nlohmann/detail/meta/type_traits.hpp index 796d5b0cda..2472f3c111 100644 --- a/include/nlohmann/detail/meta/type_traits.hpp +++ b/include/nlohmann/detail/meta/type_traits.hpp @@ -620,7 +620,7 @@ struct value_in_range_of_impl2 static constexpr bool test(T val) { using CommonType = typename std::common_type::type; - return static_cast(val) <= static_cast(std::numeric_limits::max()); + return static_cast(val) <= static_cast((std::numeric_limits::max)()); } }; @@ -630,7 +630,7 @@ struct value_in_range_of_impl2 static constexpr bool test(T val) { using CommonType = typename std::common_type::type; - return static_cast(val) <= static_cast(std::numeric_limits::max()); + return static_cast(val) <= static_cast((std::numeric_limits::max)()); } }; @@ -640,7 +640,7 @@ struct value_in_range_of_impl2 static constexpr bool test(T val) { using CommonType = typename std::common_type::type; - return val >= 0 && static_cast(val) <= static_cast(std::numeric_limits::max()); + return val >= 0 && static_cast(val) <= static_cast((std::numeric_limits::max)()); } }; @@ -651,8 +651,8 @@ struct value_in_range_of_impl2 static constexpr bool test(T val) { using CommonType = typename std::common_type::type; - return static_cast(val) >= static_cast(std::numeric_limits::min()) - && static_cast(val) <= static_cast(std::numeric_limits::max()); + return static_cast(val) >= static_cast((std::numeric_limits::min)()) + && static_cast(val) <= static_cast((std::numeric_limits::max)()); } }; diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 3341f02863..3826d27f76 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -3908,7 +3908,7 @@ struct value_in_range_of_impl2 static constexpr bool test(T val) { using CommonType = typename std::common_type::type; - return static_cast(val) <= static_cast(std::numeric_limits::max()); + return static_cast(val) <= static_cast((std::numeric_limits::max)()); } }; @@ -3918,7 +3918,7 @@ struct value_in_range_of_impl2 static constexpr bool test(T val) { using CommonType = typename std::common_type::type; - return static_cast(val) <= static_cast(std::numeric_limits::max()); + return static_cast(val) <= static_cast((std::numeric_limits::max)()); } }; @@ -3928,7 +3928,7 @@ struct value_in_range_of_impl2 static constexpr bool test(T val) { using CommonType = typename std::common_type::type; - return val >= 0 && static_cast(val) <= static_cast(std::numeric_limits::max()); + return val >= 0 && static_cast(val) <= static_cast((std::numeric_limits::max)()); } }; @@ -3939,8 +3939,8 @@ struct value_in_range_of_impl2 static constexpr bool test(T val) { using CommonType = typename std::common_type::type; - return static_cast(val) >= static_cast(std::numeric_limits::min()) - && static_cast(val) <= static_cast(std::numeric_limits::max()); + return static_cast(val) >= static_cast((std::numeric_limits::min)()) + && static_cast(val) <= static_cast((std::numeric_limits::max)()); } };