Skip to content

Commit

Permalink
default in equality operator for transform operation
Browse files Browse the repository at this point in the history
C++ 20 lets you default this operator (does memberwise-comparison)
C++ 20 will automatically define != if you define ==

Co-authored-by: Nick Gerleman <nick@nickgerleman.com>
  • Loading branch information
intergalacticspacehighway and NickGerleman authored Feb 27, 2024
1 parent 50fd7fb commit 411c84d
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,7 @@ struct TransformOperation {
ValueUnit x;
ValueUnit y;
ValueUnit z;
bool operator==(const TransformOperation& other) const {
return type == other.type && x == other.x && y == other.y && z == other.z;
}
bool operator!=(const TransformOperation& other) const {
return !(*this == other);
}
bool operator==(const TransformOperation& other) const = default;
};

struct TransformOrigin {
Expand Down

0 comments on commit 411c84d

Please sign in to comment.