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

<optional>: Relational and equality operators are constrained before C++26 #5272

Open
frederick-vs-ja opened this issue Feb 7, 2025 · 1 comment
Labels
enhancement Something can be improved

Comments

@frederick-vs-ja
Copy link
Contributor

frederick-vs-ja commented Feb 7, 2025

MSVC STL constrains some operator==, operator< etc. for optional in C++17~23 modes, while the standard doesn't constrain them until C++26 (via WG21-P2944R3).

Should we

  • just remove the SFINAE constraints before C++26, or
  • backport the constraints in C++26 added via WG21-P2944R3 and following-up LWG issues, but only for optional, or
  • backport all constraints added via WG21-P2944R3, WG21-P3379R0 (for consistency), and following-up LWG issues?
@frederick-vs-ja frederick-vs-ja added the question Further information is requested label Feb 7, 2025
@davidmrdavid
Copy link
Member

We discussed this in the maintainer's meeting - we think we 'want to be a little daring' here and backport these to C++17~23 as the constraints seem desirable: these feel like bugfixes.

The one thing that would make us backtrack on these is if these break our "RWC" / "real world code" tests to a notable degree. This is always a risk in any change made to the STL, so that shouldn't block this work.

@davidmrdavid davidmrdavid added enhancement Something can be improved and removed question Further information is requested labels Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something can be improved
Projects
None yet
Development

No branches or pull requests

2 participants