🚩 use JSON_ASSERT(x) instead of assert(x)

This commit is contained in:
Niels Lohmann 2020-07-06 12:22:31 +02:00
parent b04dc055b2
commit 98b1c6d302
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
16 changed files with 275 additions and 277 deletions

View file

@ -1,7 +1,6 @@
#pragma once
#include <array> // array
#include <cassert> // assert
#include <cstddef> // size_t
#include <cstdio> //FILE *
#include <cstring> // strlen
@ -297,13 +296,13 @@ class wide_string_input_adapter
{
fill_buffer<sizeof(WideCharType)>();
assert(utf8_bytes_filled > 0);
assert(utf8_bytes_index == 0);
JSON_ASSERT(utf8_bytes_filled > 0);
JSON_ASSERT(utf8_bytes_index == 0);
}
// use buffer
assert(utf8_bytes_filled > 0);
assert(utf8_bytes_index < utf8_bytes_filled);
JSON_ASSERT(utf8_bytes_filled > 0);
JSON_ASSERT(utf8_bytes_index < utf8_bytes_filled);
return utf8_bytes[utf8_bytes_index++];
}