Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate json_pointer/string_t comparisons #3684

Merged
merged 2 commits into from
Aug 7, 2022

Conversation

falbrechtskirchinger
Copy link
Contributor

@falbrechtskirchinger falbrechtskirchinger commented Aug 7, 2022

#3664 restored comparing json_pointer with strings but removed noexcept. This is due to no longer comparing by converting the json_pointer to string, but by converting the string to a json_pointer. Doing so is more accurate (*) as we no longer allow comparing with strings that aren't valid JSON pointers. The creation of the json_pointer temporary is hidden from the user. For that reason I suggest deprecating the string overloads to make users aware of the implications (exceptions, allocation of a json_pointer).

* The accuracy problem is of greater concern for the remaining relational operators, e.g., imagine comparing a json_pointer and the string /foo~ for less-/greater-than.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 05f30df on falbrechtskirchinger:deprecate-operators into b0422f8 on nlohmann:develop.

@nlohmann nlohmann modified the milestone: Release 3.11.2 Aug 7, 2022
Copy link
Owner

@nlohmann nlohmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@nlohmann nlohmann added this to the Release 3.11.2 milestone Aug 7, 2022
@nlohmann nlohmann merged commit a92ccaf into nlohmann:develop Aug 7, 2022
@falbrechtskirchinger falbrechtskirchinger deleted the deprecate-operators branch August 8, 2022 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants