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

Ranges Algorithms Modernization - Spaceship #13092

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mitaclaw
Copy link
Contributor

@mitaclaw mitaclaw commented Oct 1, 2024

In C++20, algorithms from the standard library evolved to feature new niceties and additional compile-time checks. Simultaneously, the way user-defined types should overload comparison operators was revamped by C++20 with the new "spaceship operator" <=>. When standard-library comparison function objects, such as std::less or std::equal, were given the ranges update treatment, it became a requirement that all six comparison operator overloads (<, <=, >, >=, ==, !=) must exist for the compared type. Due to this combination of factors, a few user-defined types in Dolphin's codebase required their comparison operator overloads be modernized before their usage in standard algorithms could be modernized. I have isolated these changes so that they may be recognized and more easily understood.

@mitaclaw
Copy link
Contributor Author

mitaclaw commented Oct 1, 2024

This PR will remain a draft until I am confident there are no mistakes in my changes.

Special shout-out to the PR that inspired me to attempt this modernization: #12992

@theboreddevvv

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants