Repository navigation
Conversation
Owner
Author
|
Besides merging the lower CI fixes (see #5617 to #5623), commit 5ba6ea1 reformats #5626, #5627 and #5628 got only propagation merges. For #5628 (SIMD), I also built the builder test with — posted by Claude Code on behalf of @nlohmann |
nlohmann
removed this pull request from stack #5636
September 30, 2026 13:19
nlohmann
force-pushed
the
json-view/13-view-dump
branch
from
September 30, 2026 13:20
3e2b810 to
7c179b3
Compare
nlohmann
force-pushed
the
json-view/14-view-compare
branch
from
September 30, 2026 13:20
6f7407a to
4f00cac
Compare
nlohmann
added this pull request to stack #5739
September 30, 2026 13:21
nlohmann
force-pushed
the
json-view/14-view-compare
branch
from
September 30, 2026 15:34
4f00cac to
adbc848
Compare
nlohmann
force-pushed
the
json-view/13-view-dump
branch
from
September 30, 2026 15:34
7c179b3 to
bd22b6e
Compare
nlohmann
force-pushed
the
json-view/14-view-compare
branch
2 times, most recently
from
September 30, 2026 18:06
1339883 to
c2792eb
Compare
nlohmann
marked this pull request as ready for review
September 30, 2026 18:17
basic_json_view gains operator== and operator!= with other views and with basic_json values. Two views are equal if the values parse() would produce for them are equal by basic_json's operator==: numbers compare by value across their types, and objects by their members, with duplicate keys resolved as parse() resolves them (the last value, at the position of the first key). Objects are compared in member order if the object type keeps an order (ordered_json), by key otherwise, as basic_json does. Discarded views compare as discarded basic_json values do, which follows JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON. Nothing is materialized except single numbers, and the walk is iterative. Tests compare the results for pairs of 1,200 generated documents (also written differently: sorted keys, canonical numbers) with those of basic_json, for json and ordered_json, plus numbers, duplicate keys, member order, discarded values, and 100,000 levels of nesting. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
- API pages for operator== and operator!= of basic_json_view, linked both ways with the basic_json pages - the feature page and the class overview list the comparisons - the examples show when the view helps: detecting a changed document without building json values Signed-off-by: Niels Lohmann <mail@nlohmann.me>
Separate the comparison of discarded values from the other types, so that the conditional chain has no repeated branch bodies, and mark the deliberate comparisons of views with empty containers in the tests. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
compare.hpp includes <string> (build/include_what_you_use). Signed-off-by: Niels Lohmann <mail@nlohmann.me>
The "check" job runs astyle over the documentation examples once it gets past the amalgamation step. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
nlohmann
force-pushed
the
json-view/13-view-dump
branch
from
September 30, 2026 19:15
48307dc to
bc56ac6
Compare
nlohmann
force-pushed
the
json-view/14-view-compare
branch
from
September 30, 2026 19:15
c2792eb to
b992e1f
Compare
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
Conflicts in See also lists (docs/mkdocs/docs/api/basic_json/operator_ne.md), where develop (#5638) and this branch both edited: kept develop's entries and added this branch's basic_json_view links. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
nlohmann
removed this pull request from stack #5739
October 6, 2026 09:26
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the stack for the zero-copy view (#5295).
Summary
operator==andoperator!=compare two views, or a view and abasic_jsonvalue in either order. They answer whether the valuesparse()would produce are equal bybasic_json'soperator==:1 == 1.0);parse()resolves them: the last value, at the position of the first key;ordered_json) and not otherwise, exactly asbasic_jsoncompares;basic_jsonvalues do, includingJSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON.Nothing is materialized except single scalars, and the walk is iterative. There is no
operator<.Tests
basic_json, forjsonand forordered_json.Public API
No breaking change: new operators of the view.
Written by Claude Code.
🤖 Generated with Claude Code