mirror of
https://github.com/nlohmann/json.git
synced 2026-11-03 11:25:33 +00:00
json_view: no constant operand in the number dispatch (MSVC C4127)
The `!negative ||` that #6006 added to the digit test of the number scan has a constant left operand in the template (negative is a template argument), so MSVC reports C4127 under /WX in builder.hpp(1177). Restore the plain test; the branch behaves the same. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
2 files changed
+2
-4
No files matched your search
@@ -1174,9 +1174,8 @@ indent_done:
|
||||
{
|
||||
++p;
|
||||
}
|
||||
else if (!negative || NLOHMANN_VIEW_LIKELY(cur() >= '1' && cur() <= '9'))
|
||||
else if (NLOHMANN_VIEW_LIKELY(cur() >= '1' && cur() <= '9'))
|
||||
{
|
||||
// (without a sign, the dispatch saw a digit)
|
||||
p = skip_digits(p + 1, e);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user