Commit Graph

313 Commits

Author SHA1 Message Date
Niels Lohmann 146e5e0bc7 Merge iterator+sentinel overloads and fix ambiguity/CI issues
Address PR review feedback and CI failures:

- Merge the separate same-type and sentinel-type iterator overloads of
  parse(), accept(), sax_parse(), and the five from_* binary deserializers
  into a single overload with SentinelType defaulted to IteratorType,
  as suggested in review. Applied the same simplification to the
  detail::input_adapter() free functions.
- Fix a latent ambiguity: some compilers (e.g. GCC 4.8) unreliably SFINAE
  the operator!= detection for std::nullptr_t against container/string
  types, making calls like parse(s, nullptr, ...) ambiguous with the
  compatible-input overload. can_compare_ne now explicitly excludes
  std::nullptr_t as a SentinelType.
- Use a named enable_if_t template parameter instead of an unnamed
  function parameter for the SFINAE guard, fixing a clang-tidy
  hicpp-named-parameter/readability-named-parameter failure.
- Update parse.md, accept.md, sax_parse.md, and the five from_*.md pages
  to document the merged overload instead of separate (2)/(3) overloads,
  also fixing an over-160-char line that broke the documentation
  style_check CI job.
- Rework the BSON iterator+sentinel test to parse a BSON file already
  present in the test suite instead of writing/deleting a temp file.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-07-10 23:15:17 +02:00
Niels Lohmann 2269656bc6 Add iterator+sentinel tests and docs for binary deserializers
This commit extends the C++20 ranges support (iterator+sentinel pairs) to the
binary format deserializers from_cbor, from_msgpack, from_ubjson, from_bjdata,
and from_bson, matching what was already done for parse(), accept(), and
sax_parse().

Changes:
- Add istreambuf_sentinel helper to test_utils.hpp for EOF detection in tests
- Add 5 new test cases that read binary files directly via
  std::istreambuf_iterator<char> + sentinel, without pre-buffering
- Update documentation for all 5 from_* functions to document overload (3)
  with SentinelType parameter
- All tests pass; verified against existing test suite data
- Fix potential buffer over-read warning in heterogeneous iterator test

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-07-10 19:50:04 +02:00
Niels Lohmann b630f5e9c7 Fix container input_adapter SFINAE for lvalue-only ADL begin/end (#5260)
* Fix container input_adapter SFINAE for lvalue-only ADL begin/end (#111)

The container overload of json::parse(c) / accept(c) / sax_parse(c, ...)
silently dropped from overload resolution for user types whose ADL
begin(T&) / end(T&) accepted only non-const lvalue references
(a legitimate pattern matching std::begin semantics). This was because
the detection code used std::declval<ContainerType>() which synthesized
an rvalue, and the rvalue failed to bind to lvalue-only ADL functions.

Fix by making both the outer input_adapter(ContainerType&&) and the
factory's create(ContainerType&&) forwarding references, preserving the
caller's value category and constness via reference collapsing. This
ensures detection (std::declval) and actual use (std::forward) always
match without needing decay/remove_reference.

- Rewrite input_adapters.hpp container overload with forwarding refs
- Add regression tests for lvalue-only non-const ADL begin/end
- Add regression test for rvalue containers (no breakage)
- Update API docs (parse, accept, sax_parse, from_*) to clarify
  that begin/end must match std::begin/std::end semantics
- Add version history notes for 3.13.0
- Regenerate amalgamation

Second-order effect: binary_reader.hpp's internal call to
input_adapter(number_vector) now deduces iterator vs const_iterator
based on the lvalue; functionally harmless (iterator_input_adapter is
iterator-type-agnostic), verified via unit-ubjson/unit-bjdata tests.

Closes remaining limitation from #4354 / PR #5218 (todo 106).

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* Avoid strlen() in test container to fix Codacy CWE-126 flag

Suppressing the strlen()-based CWE-126 warning with NOLINT/nosec
comments only silenced clang-tidy and the standalone Flawfinder
Action; Codacy's own analysis (which also flags this pattern and
doesn't honor those suppression comments) still reported it as a new
issue, plus flagged the near-duplicate begin/end pair as cloned code.

Store the buffer's size explicitly in MyContainerNonConstADL instead
of computing it via strlen() in end(), which removes the flagged
pattern outright and also de-duplicates the struct from the existing
MyContainer's char*-based begin/end pair.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* Avoid trailing return type to satisfy clang-tidy fuchsia-trailing-return

The forwarding-reference input_adapter(ContainerType&&) entry point was
written with an auto/trailing-decltype return type, but this project's
ci_clang_tidy job enables the fuchsia-trailing-return check as an
error, which rejects it. The return type only depends on the template
parameter ContainerType, not on the runtime parameter, so it can be
written as an ordinary leading return type instead - no functional
change.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* Avoid C-style array in test to satisfy clang-tidy avoid-c-arrays

clang-tidy's cppcoreguidelines/hicpp/modernize-avoid-c-arrays checks
flagged the char raw_data[] declaration used to reproduce the
lvalue-only non-const ADL begin/end scenario. Use std::string instead
and take a mutable pointer via &raw_data[0], which is the standard
way to get a non-const char* into a string's buffer under C++11
(std::string::data() only returns non-const in C++17 and later).

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-07-10 13:56:06 +02:00
Niels Lohmann 855f511db4 Fix stale Clang -Weverything suppression comments; drop -Wno-missing-noreturn (#5250)
* Fix stale Clang -Weverything suppression comments; eliminate -Wno-missing-noreturn

cmake/clang_flags.cmake claimed -Wno-unsafe-buffer-usage was needed only
for Doctest and that -Wno-missing-noreturn had "no way to silence...
otherwise" (PR #4871, which never actually attempted a source fix).
Neither held up under investigation (todo 130):

- -Wno-unsafe-buffer-usage is pervasive (208 distinct sites across 19
  files measured with clang trunk in silkeh/clang:dev), spanning the
  library's own low-level numeric/buffer code (to_chars, serializer,
  lexer, binary reader/writer, input adapters, json_pointer) as well as
  vendored Doctest itself (96 of the 208 sites). A source-level fix is
  not feasible at this scale; the comment now says so instead of
  blaming Doctest alone.

- -Wno-missing-noreturn had exactly two real trigger sites, both
  genuinely and unconditionally non-returning: a test-only throwing
  allocator (tests/src/unit-allocator.cpp) and, previously undiscovered,
  wide_string_input_adapter::get_elements<T>() in
  include/nlohmann/detail/input/input_adapters.hpp. Verified this isn't
  a wider pattern by checking all 160 JSON_THROW call sites in the
  library for functions whose entire body is an unconditional throw.
  Annotated both ([[noreturn]] in the test file, since JSON_HEDLEY_NO_RETURN
  is #undef'd by the time test code runs; JSON_HEDLEY_NO_RETURN in the
  library file, its first real use anywhere in the codebase) and
  dropped the suppression entirely.

single_include/nlohmann/json.hpp regenerated via `make amalgamate`;
`make check-amalgamation` passes.

Verified in Docker (silkeh/clang:dev, matching the ci_static_analysis_clang
CI job): baseline builds clean, and the full 194-target test suite builds
with zero warnings under the corrected CLANG_CXXFLAGS (-Wno-missing-noreturn
no longer in the list). Also sanity-compiled and ran unit-allocator.cpp and
unit-wstring.cpp on host Apple Clang to confirm behavior is unchanged.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* Fix MSVC C4702 warning caused by JSON_HEDLEY_NO_RETURN on get_elements()

PR #5250 annotated wide_string_input_adapter::get_elements<T>() with
JSON_HEDLEY_NO_RETURN (it unconditionally throws). On MSVC this expands to
__declspec(noreturn), and MSVC correctly determined that the code following
its call in binary_reader.hpp is unreachable for that instantiation, firing
C4702 under /W4 /WX in the msvc, msvc-vs2026, and msvc-arm64 Debug jobs.

Clang doesn't flag this case, so the Docker verification for #5250 (which
only checked Clang -Weverything) didn't catch it.

This is the same warning class already tolerated for Release builds since
PR #5216, where MSVC's optimizer independently found the same dead code
after /Od was removed. Extend that existing /wd4702 suppression to Debug
builds too, instead of reverting the noreturn annotation.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-07-09 20:18:28 +02:00
Niels Lohmann 83c87cb9e0 Read binary strings/blobs in bulk chunks with a memcpy fast path (#5233) 2026-07-05 19:26:02 +02:00
Niels Lohmann eed1587000 Reconstruct lexer diagnostics lazily for seekable input (#120) (#5234)
`lexer::get()` copied every scanned character into `token_string` on the
whole successful-parse hot path, yet that buffer is consumed only by
`get_token_string()` when rendering the "last read" fragment of a parse
error. On well-formed input the per-byte copy (plus the `unget()` pop)
is pure overhead that is always discarded.

For seekable input adapters - random-access, single-byte iterators such
as those backing `std::string`, `const char*`, and `std::vector<char>` -
the offending token is now reconstructed on demand from the input when
an error is reported, using a saved start offset, and the eager copy is
skipped. Streaming adapters (file, istream, wide-string, and user-defined
adapters) keep the eager copy; the strategy is chosen at compile time via
`input_adapter_supports_seek`, so adapters without the capability are
unaffected.

Error messages are byte-for-byte identical across all adapters, verified
by a new parity regression test. Microbenchmark (4 MB mixed JSON, parsed
from a std::string): ~149 -> ~160 MB/s, about +8%.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 10:42:48 +02:00
Niels Lohmann c5b2b26fdc 📡 fix docs (#5217) 2026-06-29 22:15:18 +02:00
Niels Lohmann f8eee1bb79 Annotate unreachable comment-scanner switch paths to satisfy C26819 (#5071) 2026-02-07 09:15:18 +01:00
Ville Vesilehto 457bc283ff fix(cbor): reject overflowing negative integers (#5039)
* fix(cbor): reject negative ints overflowing int64

CBOR encodes negative integers as "-1 - n" where n is uint64_t. When
n > INT64_MAX, casting to int64_t caused undefined behavior and silent
data corruption. Large negative values were incorrectly parsed as
positive integers (e.g., -9223372036854775809 became 9223372036854775807).

Add bounds check for to reject values that exceed int64_t
representable range, returning parse_error instead of silently
corrupting data.

Added regression test cases to verify.

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>

* chore: clarify tests

Add test for "n=0" case (result=-1) to cover the smallest magnitude
boundary. Update comments to explain CBOR 0x3B encoding and why
"result=0" is not possible. Clarify that n is an unsigned integer
in the formula "result = -1 - n" to help understanding the tests.

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>

* fix(cbor): extend overflow checks for other types

Extend negative integer overflow detection to all CBOR negative
integer cases (0x38, 0x39, 0x3A) for consistency with the existing
0x3B check.

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>

---------

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
2026-01-12 10:17:47 +01:00
Niels Lohmann 515d994acb 🦉 adjust year (#5044)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-01-01 20:00:39 +01:00
Niels Lohmann 54be9b04f0 🦉 update REUSE (#4960) 2025-10-23 06:56:36 +02:00
Niels Lohmann 30d27df61c Fix CI (#4871)
* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-07-31 20:10:57 +02:00
David Kilzer d70e46bc65 🚷 add missing header to input_adapters.hpp (#4830)
Signed-off-by: David Kilzer <ddkilzer@apple.com>
Co-authored-by: David Kilzer <ddkilzer@apple.com>
2025-06-25 07:20:17 +02:00
Niels Lohmann cf16c5ab9f Use binary_t::value_type (#4805) 2025-06-02 06:35:27 +02:00
chirsz 4b17f90f65 Add ignore_trailing_commas option (#4609)
Added examples and modified the corresponding documents and unit tests.

Signed-off-by: chirsz-ever <chirsz-ever@outlook.com>
Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>
2025-05-22 08:01:46 +02:00
Niels Lohmann 9110918cf8 Fix typos (#4748)
* ✏️ fix typos

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ✏️ address review comments

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ✏️ address review comments

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-05-04 10:28:24 +02:00
Ville Vesilehto dff2b4756c fix: BJData size calculation overflow (#4765)
Adds pre-multiplication overflow detection to catch cases where dimension
products would exceed size_t max. The previous check only detected when
overflow resulted in exactly 0 or SIZE_MAX, missing other cases.

Retains the original post-multiplication check for backward compatibility.
Adds tests verifying overflow detection with dimensions (2^32+1)×(2^32),
which previously overflowed silently to 2^32.

This prevents custom SAX handlers from receiving incorrect array sizes
that could lead to buffer overflows.

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
2025-04-29 10:17:50 +02:00
Niels Lohmann eef76c200e Make library work with C++20 modules (#4764)
*  add test for C++20 modules

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🎓 fix warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* Add missing header (#4763)

* 🚷 add missing header

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🎓 fix warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🎓 fix warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-28 21:52:26 +02:00
Niels Lohmann c67d538274 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>
2025-04-17 18:04:09 +02:00
Niels Lohmann 1705bfe914 🔫 set version to 3.12.0 (#4727)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-11 10:41:14 +02:00
Niels Lohmann b477d2b95e Suppress clang-analyzer-webkit.NoUncountedMemberChecker (#4701)
* 🎓 suppress clang-analyzer-webkit.NoUncountedMemberChecker

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🎓 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 📡 add Clang 20/21

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🎓 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🎓 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🎓 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🎓 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🎓 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🎓 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🎓 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🎓 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-03-29 09:38:45 +01:00
Niels Lohmann f06604fce0 Bump the copyright years (#4606)
* 🦉 bump the copyright years

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🦉 bump the copyright years

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🦉 bump the copyright years

Signed-off-by: Niels Lohmann <niels.lohmann@gmail.com>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
Signed-off-by: Niels Lohmann <niels.lohmann@gmail.com>
2025-01-19 17:04:17 +01:00
Michael Valladolid 2d42229f4d Support BSON uint64 de/serialization (#4590)
* Support BSON uint64 de/serialization

Signed-off-by: Michael Valladolid <mikevalladolid@gmail.com>

* Treat 0x11 as uint64 and not timestamp specific

Signed-off-by: Michael Valladolid <mikevalladolid@gmail.com>

---------

Signed-off-by: Michael Valladolid <mikevalladolid@gmail.com>
2025-01-10 14:59:55 +01:00
Nebojša Cvetković 2e50d5b2f3 BJData optimized binary array type (#4513) 2025-01-07 18:09:19 +01:00
Michael Valladolid 4f64d8d0b4 Modernize integer comparison (#4577)
Replace static_cast<size_t>(-1) with std::numeric_limits<std::size_t>::max()
via the detail::unknown_size() function
2025-01-01 17:01:38 +01:00
Sushrut Shringarputale 58f5f25968 json start/end position implementation (#4517)
* Add implementation to retrieve start and end positions of json during parse

* Add more unit tests and add start/stop parsing for arrays

* Add raw value for all types

* Add more tests and fix compiler warning

* Amalgamate

* Fix CLang GCC warnings

* Fix error in build

* Style using astyle 3.1

* Fix whitespace changes

* revert

* more whitespace reverts

* Address PR comments

* Fix failing issues

* More whitespace reverts

* Address remaining PR comments

* Address comments

* Switch to using custom base class instead of default basic_json

* Adding a basic using for a json using the new base class. Also address PR comments and fix CI failures

* Address decltype comments

* Diagnostic positions macro (#4)

Co-authored-by: Sush Shringarputale <sushring@linux.microsoft.com>

* Fix missed include deletion

* Add docs and address other PR comments (#5)

* Add docs and address other PR comments

---------

Co-authored-by: Sush Shringarputale <sushring@linux.microsoft.com>

* Address new PR comments and fix CI tests for documentation

* Update documentation based on feedback (#6)

---------

Co-authored-by: Sush Shringarputale <sushring@linux.microsoft.com>

* Address std::size_t and other comments

* Fix new CI issues

* Fix lcov

* Improve lcov case with update to handle_diagnostic_positions call for discarded values

* Fix indentation of LCOV_EXCL_STOP comments

* fix amalgamation astyle issue

---------

Co-authored-by: Sush Shringarputale <sushring@linux.microsoft.com>
2024-12-18 22:46:14 +01:00
Niels Lohmann 30cd44df95 Clean up CI (#4553)
* 🧛 overwork cppcheck

* 👪 adjust permissions

* 🧛 fixes

* 🧛 fixes
2024-12-17 18:58:05 +01:00
Niels Lohmann 1b9a9d1f21 Update licenses (#4521)
* 🦉 update licenses

* 🦉 update licenses
2024-11-29 17:38:42 +01:00
Tianyi Chen 935c6eeb5a Optimize binary get_number implementation by reading multiple bytes at once (#4391)
* multibyte binary reader

* wide_string_input_adapter fallback to get_character

Update input_adapters.hpp

* Update json.hpp

* Add from msgpack test

* Test for broken msgpack with stream, address some warnings

* Reading binary number from wchar as an error, address warnings

* Not casting float to int, it violates strict aliasing rule
2024-11-29 09:19:58 +01:00
Niels Lohmann ee32bfc1c2 Make SAX output locale-independent (#4505)
* 🚷 make SAX output locale-independent #4084

*  add test

*  add test

*  add test

*  add test

*  add test

*  add test

* 🚷 make SAX output locale-independent #4084

* 🚷 make SAX output locale-independent #4084

* 🚷 make SAX output locale-independent #4084

* 🚷 make SAX output locale-independent #4084

* 🚷 make SAX output locale-independent #4084

* 🚷 make SAX output locale-independent #4084

* 🚷 make SAX output locale-independent #4084

* 🚷 make SAX output locale-independent #4084

* 🚷 make SAX output locale-independent #4084

* 🚷 make SAX output locale-independent #4084

* 🚷 make SAX output locale-independent #4084

* 🚷 make SAX output locale-independent #4084
2024-11-24 21:14:00 +01:00
Stuart Gorman f9f8c07792 fix: integer parsed as float when EINTR set in errno (#4506)
* fix: integer parsed as float when EINTR set in errno

* chore: make amalgamate

* chore: make pretty

---------

Co-authored-by: Stuart Gorman <Stuart.Gorman@kallipr.com>
2024-11-21 13:09:29 +01:00
jh96 1f218e1074 Possible fix for #4485 (#4487)
* Possible fix for #4485

Throw's an exception when i is nullptr,
also added a testcase for this scenario though most likely in the wrong test file.cpp

* quick cleanup

* Fix compile issues

* moved tests around, changed exceptions, removed a possibly unneeded include

* add back include <memory> for testing something

* Ninja doesn't like not having a \n, at end of file, adding it back

* update input_adapter file to deal with empty/null file ptr.

* ran make pretty

* added test for inputadapter

* ran make amalgamate

* Update tests/src/unit-deserialization.cpp

Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>

* Update tests/src/unit-deserialization.cpp

Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>

* Update input adapters.hpp with new includes

* fix unabigious use of _, (there was a double declare)

* did the amalagamate

* rm duplicate includes

* make amalgamate again

* reorder

* amalgamate

* moved it above

* amalgamate

---------

Co-authored-by: Jordan <jordan-hoang@users.noreply.github.com>
Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>
2024-11-19 13:54:04 +01:00
Niels Lohmann 1825117e63 Another desperate try to fix the CI (#4489)
* 🎓 fix warning

* 🧛 update actions

* 🎓 fix warning

* 🎓 fix warning

* 🎓 fix warning

* 🧛 update actions

* 🧛 update actions

* 🎓 fix warning

* 🎓 fix warning

* 🧛 update actions

* 🎓 fix warning

* 🧛 update actions

* 🧛 update actions

* 🧛 update actions

* 🎓 fix warning

* 🎓 fix warning

* 🎓 fix warning

* 🎓 fix warning

* 🧛 update actions

* 🧛 update actions

* 🎓 fix warning

* 🧛 update actions

* 🧛 update actions

* 🧛 update actions

* 🧛 update actions

* 🧛 update actions
2024-11-13 10:21:26 +01:00
Niels Lohmann 4a602df34e Add lgtm explanation (#4362) 2024-11-10 13:15:23 +01:00
Niels Lohmann c35d260c2f Suppress Clang-Tidy warnings (#4276) 2024-01-28 14:04:07 +01:00
Niels Lohmann 9cca280a4d JSON for Modern C++ 3.11.3 (#4222) 2023-11-28 22:36:31 +01:00
Colby Haskell 1d597743d8 Fix char_traits deprecation warning (#4179) 2023-11-27 06:51:25 +01:00
Niels Lohmann f56c6e2e30 Update documentation for the next release (#4216) 2023-11-26 15:51:19 +01:00
Colby Haskell 59da644db4 Add more specific error message when attempting to parse empty input (#4180) 2023-10-31 20:17:43 +01:00
Mathieu Westphal 6adae02ddd Fix spellcheck issue (#4173) 2023-10-04 15:24:38 +02:00
Niels Lohmann 1ce29fa22f Fix CI (#4160) 2023-09-23 17:19:28 +02:00
Niels Lohmann 836b7beca4 Fix CI, again (#4083) 2023-09-07 20:41:12 +02:00
Raphael Grimm bbe337c3a3 Prevent memory leak when exception is thrown in adl_serializer::to_json (#3901)
Co-authored-by: barcode <barcode@example.com>
2023-03-08 13:43:45 +01:00
Dirk Stolle 4b2c8ce6bc Fix some typos for n-dimensional arrays (#3767) 2022-09-26 06:23:18 +02:00
Niels Lohmann 58bd97e2b1 Add clang-tools to required tools for ci_static_analysis_clang (#3724)
* 🧛 add clang-tools to required tools for ci_static_analysis_clang

* 🎓 update Clang-Tidy warning selection

* 🎓 fix Clang-Tidy warnings

* 🎓 fix Clang-Tidy warnings

* 🎓 fix Clang-Tidy warnings

* 🎓 fix Clang-Tidy warnings

* 🎓 fix Clang-Tidy warnings

* 🎓 fix Clang-Tidy warnings

* 🎓 fix Clang-Tidy warnings

* 🎓 fix Clang-Tidy warnings

* 🎓 fix Clang-Tidy warnings

* 🎓 fix Clang-Tidy warnings

* 🎓 fix Clang-Tidy warnings (#3738)

*  revert fix

*  revert fix

* 🎓 fix Clang-Tidy warnings (#3739)

Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
2022-09-13 12:58:26 +02:00
Niels Lohmann 9d69186291 🔫 set version to 3.11.2 2022-08-12 15:04:06 +02:00
Florian Albrechtskirchinger 32242022f7 Minor BJData fixes (#3637)
* Replace vector/map LUTs in binary_reader with arrays

* Replace string_t::npos in binary_reader
2022-08-03 09:15:37 +02:00
Niels Lohmann f2020da0dd 🔫 set version to 3.11.1 2022-08-01 23:27:58 +02:00
Niels Lohmann ce0e13ccea 🔫 set version to 3.11.0 2022-07-31 23:19:06 +02:00
Florian Albrechtskirchinger d909f80960 Add versioned, ABI-tagged inline namespace and namespace macros (#3590)
* Add versioned inline namespace

Add a versioned inline namespace to prevent ABI issues when linking code
using multiple library versions.

* Add namespace macros

* Encode ABI information in inline namespace

Add _diag suffix to inline namespace if JSON_DIAGNOSTICS is enabled, and
_ldvcmp suffix if JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON is enabled.

* Move ABI-affecting macros into abi_macros.hpp

* Move std_fs namespace definition into std_fs.hpp

* Remove std_fs namespace from unit test

* Format more files in tests directory

* Add unit tests

* Update documentation

* Fix GDB pretty printer

* fixup! Add namespace macros

* Derive ABI prefix from NLOHMANN_JSON_VERSION_*
2022-07-30 21:59:13 +02:00