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

Add operator< to , to allow use as a map key #3680

Closed
wants to merge 1 commit into from
Closed

Add operator< to , to allow use as a map key #3680

wants to merge 1 commit into from

Conversation

khiner
Copy link

@khiner khiner commented Aug 5, 2022

This is a replacement for #3667

After looking at how extensive the commit for the other equality operators is, I see how much this PR needs that's not here (tests/docs/etc). I'm more than happy to cargo code/copy-paste and edit based on that commit to make this one look just like that. Lmk if that would be of value and actually helpful and not just a burden to you vs doing it yourself.

@khiner khiner requested a review from nlohmann as a code owner August 5, 2022 18:48
@github-actions github-actions bot added the M label Aug 5, 2022
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 9ebfeb7 on khiner:develop into 7b6cf59 on nlohmann:develop.

@falbrechtskirchinger
Copy link
Contributor

I'm not too happy with the current state of the operator==/!= string overloads, but not having them means we're not compatible with v3.10.5.
Technically, the same is true for the other operators, but I'm hoping that those are rarely used in practice.

Since you're only looking for map support, maybe we should limit this PR to comparing two JSON pointers for less-than and be done.

If @nlohmann doesn't object, I'd also skip the documentation for now. It's actually easier for me to copy and adjust the documentation from basic_json/json_pointer, once all operators (including <=>) are done.

Also, note that I'm considering one more (small) change to the existing operators. There shouldn't be any merge conflicts or only minor ones. (Waiting on feedback before I proceed.)

@falbrechtskirchinger
Copy link
Contributor

I added the bare minimum to get map support into 3.11.2. Hope you don't mind. (#3685)

I'll add documentation when I add the remaining operators if Niels allows it.

@khiner
Copy link
Author

khiner commented Aug 7, 2022

Thanks @falbrechtskirchinger !

khiner added a commit to khiner/flowgrid that referenced this pull request Aug 7, 2022
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.

4 participants