Make max_input_size a function (GCC -Wunused-const-variable)

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-11 10:27:54 +02:00
1 parent 1d948b31e9
commit 4a4aa8cfc0
4 files changed
+7 -4

No files matched your search

+1 -1
View File
@@ -457,7 +457,7 @@ TEST_CASE("json_view")
{
// 32-bit offsets: the limit is 4 GiB minus 16 bytes (a margin below 2^32),
// which is what the exception message and the documentation say
const std::size_t limit = nlohmann::detail::view::max_input_size;
const std::size_t limit = nlohmann::detail::view::max_input_size();
CHECK(limit == std::size_t{4294967279u});
const oversized_input input{limit + 1};