Skip to content

Use the with_*_t aliases in the remaining tests and docs - #5790

Merged
nlohmann merged 1 commit into
developfrom
refactor/use-with-aliases-2
Oct 9, 2026
Merged

nlohmann merged 1 commit into
developfrom
refactor/use-with-aliases-2

Conversation

@nlohmann

@nlohmann nlohmann commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Follow-up to #5787, as pointed out in #5787 (comment). #5787 missed the instantiations written as basic_json < (astyle's formatting) or ending in the CustomBaseClass argument. This converts the remaining 15:

  • docs/mkdocs/docs/api/basic_json/binary_t.md: ordered_json::with_binary_t<std::vector<std::byte>> (the one @gregmarr found)
  • docs/mkdocs/docs/examples/as_base_class.cpp, tests/src/unit-custom-base-class.cpp (2): with_base_class_t
  • tests/src/unit-bson.cpp (2), tests/src/unit-custom-binary-type.cpp (2), tests/src/unit-msgpack.cpp (6), tests/src/unit-ordered_json2.cpp (1): with_binary_t / with_string_t / with_array_t / with_object_t

Each alias changes exactly the parameters that differed from the defaults, so every type is unchanged. A second sweep of tests/src, docs, and README.md found no other spelled-out instantiations. The ones left are those where the parameter list is the subject (alias tests in unit-udt.cpp, with_t.md, ordered_json.md, explicit instantiations).

Verified locally: test-bson, test-msgpack, test-custom-base-class, test-ordered_json2 (C++11) and test-custom-binary-type (C++11 and C++17, covering the std::byte branch) pass. The as_base_class example output matches its .output file.

Public API

No breaking changes. Only tests, an example, and documentation are touched.

🤖 Generated with Claude Code

#5787 missed the instantiations spelled as `basic_json <` (astyle's
formatting) or ending in the CustomBaseClass argument. Convert them,
including the binary_t.md example pointed out in review.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
@nlohmann nlohmann added this to the Release 3.13.0 milestone Oct 9, 2026
@nlohmann
nlohmann merged commit d540750 into develop Oct 9, 2026
271 of 275 checks passed
@nlohmann
nlohmann deleted the refactor/use-with-aliases-2 branch October 9, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants