Fix clang-tidy and clang 3.4/3.5 failures in the custom number type changes

Parenthesize n % 10 in integer_to_string for
readability-math-missing-parentheses, and give class_int non-template
constructors (as absl::int128 has): clang 3.4 and 3.5 reject the defaulted
basic_json::data() constructor for a number type with template constructors.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-11 15:38:22 +02:00
1 parent c10760455b
commit 170a32b27d
3 files changed
+13 -8

No files matched your search

@@ -920,7 +920,7 @@ class binary_writer
std::string result;
do
{
result.push_back(static_cast<char>('0' + n % 10));
result.push_back(static_cast<char>('0' + (n % 10)));
n = static_cast<NumberType>(n / 10);
}
while (n != 0);