mirror of
https://github.com/nlohmann/json.git
synced 2025-07-31 10:24:23 +03:00
Fix C4702 warning and extend MSVC CI job (#4749)
* ⚗️ try matrix for latest Signed-off-by: Niels Lohmann <mail@nlohmann.me> * ♻️ refactor from https://github.com/nlohmann/json/issues/4745#issuecomment-2810128420 Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 👷 simplify CI Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 👷 simplify CI Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 🚨 fix cpplint warning Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 👷 simplify CI Signed-off-by: Niels Lohmann <mail@nlohmann.me> --------- Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
@ -12601,17 +12601,22 @@ class binary_reader
|
||||
{
|
||||
return;
|
||||
}
|
||||
if constexpr(std::is_integral_v<NumberType>)
|
||||
else if constexpr(std::is_integral_v<NumberType>)
|
||||
{
|
||||
number = std::byteswap(number);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
auto* ptr = reinterpret_cast<std::uint8_t*>(&number);
|
||||
for (std::size_t i = 0; i < sz / 2; ++i)
|
||||
else
|
||||
{
|
||||
std::swap(ptr[i], ptr[sz - i - 1]);
|
||||
#endif
|
||||
auto* ptr = reinterpret_cast<std::uint8_t*>(&number);
|
||||
for (std::size_t i = 0; i < sz / 2; ++i)
|
||||
{
|
||||
std::swap(ptr[i], ptr[sz - i - 1]);
|
||||
}
|
||||
#ifdef __cpp_lib_byteswap
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user