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 default equality operators #22

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RichLogan
Copy link
Contributor

@RichLogan RichLogan commented Nov 7, 2023

Adds C++20 equality/spaceship default operators.

@RichLogan RichLogan requested a review from paulej November 7, 2023 11:50
@JulesRapanga
Copy link
Contributor

Mygdonus isn't going to be able to move to C++20 for a while yet

@@ -162,11 +194,15 @@ namespace gs
Loc1 scale;
Boolean active;
std::optional<ObjectID> parent;

bool operator==(const Object1 &other) const = default;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason this one (and a couple of others) use operator== and the most use operator<=>?

Copy link
Contributor Author

@RichLogan RichLogan Nov 7, 2023

Choose a reason for hiding this comment

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

I had some issues with <=> not being defined on std::optional or std::vector (which might vary by implementation?), so for the types using those I just stuck with the equality that I needed.

@@ -11,7 +11,7 @@ add_library(gse

set_target_properties(gse
PROPERTIES
CXX_STANDARD 17
CXX_STANDARD 20
Copy link
Contributor

Choose a reason for hiding this comment

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

Is everyone dependent on this code OK with the move to C++20?

Copy link
Contributor

Choose a reason for hiding this comment

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

No

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

Successfully merging this pull request may close these issues.

3 participants