mirror of
https://github.com/nlohmann/json.git
synced 2024-11-23 22:19:02 +08:00
Fixed latest build error in msvc platform (#3630)
* Fixed latest build error in msvc platform warnings in msvc about mix/max macro while windows.h is used in the project #762 * Update for CI None * Update single_include/nlohmann/json.hpp Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com> Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
This commit is contained in:
parent
a2578d1d50
commit
fc3e64cbf9
@ -619,7 +619,7 @@ struct value_in_range_of_impl2<OfType, T, false, false>
|
||||
static constexpr bool test(T val)
|
||||
{
|
||||
using CommonType = typename std::common_type<OfType, T>::type;
|
||||
return static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
|
||||
return static_cast<CommonType>(val) <= static_cast<CommonType>((std::numeric_limits<OfType>::max)());
|
||||
}
|
||||
};
|
||||
|
||||
@ -629,7 +629,7 @@ struct value_in_range_of_impl2<OfType, T, true, false>
|
||||
static constexpr bool test(T val)
|
||||
{
|
||||
using CommonType = typename std::common_type<OfType, T>::type;
|
||||
return static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
|
||||
return static_cast<CommonType>(val) <= static_cast<CommonType>((std::numeric_limits<OfType>::max)());
|
||||
}
|
||||
};
|
||||
|
||||
@ -639,7 +639,7 @@ struct value_in_range_of_impl2<OfType, T, false, true>
|
||||
static constexpr bool test(T val)
|
||||
{
|
||||
using CommonType = typename std::common_type<OfType, T>::type;
|
||||
return val >= 0 && static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
|
||||
return val >= 0 && static_cast<CommonType>(val) <= static_cast<CommonType>((std::numeric_limits<OfType>::max)());
|
||||
}
|
||||
};
|
||||
|
||||
@ -650,8 +650,8 @@ struct value_in_range_of_impl2<OfType, T, true, true>
|
||||
static constexpr bool test(T val)
|
||||
{
|
||||
using CommonType = typename std::common_type<OfType, T>::type;
|
||||
return static_cast<CommonType>(val) >= static_cast<CommonType>(std::numeric_limits<OfType>::min())
|
||||
&& static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
|
||||
return static_cast<CommonType>(val) >= static_cast<CommonType>((std::numeric_limits<OfType>::min)())
|
||||
&& static_cast<CommonType>(val) <= static_cast<CommonType>((std::numeric_limits<OfType>::max)());
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -3977,7 +3977,7 @@ struct value_in_range_of_impl2<OfType, T, false, false>
|
||||
static constexpr bool test(T val)
|
||||
{
|
||||
using CommonType = typename std::common_type<OfType, T>::type;
|
||||
return static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
|
||||
return static_cast<CommonType>(val) <= static_cast<CommonType>((std::numeric_limits<OfType>::max)());
|
||||
}
|
||||
};
|
||||
|
||||
@ -3987,7 +3987,7 @@ struct value_in_range_of_impl2<OfType, T, true, false>
|
||||
static constexpr bool test(T val)
|
||||
{
|
||||
using CommonType = typename std::common_type<OfType, T>::type;
|
||||
return static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
|
||||
return static_cast<CommonType>(val) <= static_cast<CommonType>((std::numeric_limits<OfType>::max)());
|
||||
}
|
||||
};
|
||||
|
||||
@ -3997,7 +3997,7 @@ struct value_in_range_of_impl2<OfType, T, false, true>
|
||||
static constexpr bool test(T val)
|
||||
{
|
||||
using CommonType = typename std::common_type<OfType, T>::type;
|
||||
return val >= 0 && static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
|
||||
return val >= 0 && static_cast<CommonType>(val) <= static_cast<CommonType>((std::numeric_limits<OfType>::max)());
|
||||
}
|
||||
};
|
||||
|
||||
@ -4008,8 +4008,8 @@ struct value_in_range_of_impl2<OfType, T, true, true>
|
||||
static constexpr bool test(T val)
|
||||
{
|
||||
using CommonType = typename std::common_type<OfType, T>::type;
|
||||
return static_cast<CommonType>(val) >= static_cast<CommonType>(std::numeric_limits<OfType>::min())
|
||||
&& static_cast<CommonType>(val) <= static_cast<CommonType>(std::numeric_limits<OfType>::max());
|
||||
return static_cast<CommonType>(val) >= static_cast<CommonType>((std::numeric_limits<OfType>::min)())
|
||||
&& static_cast<CommonType>(val) <= static_cast<CommonType>((std::numeric_limits<OfType>::max)());
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user