File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -74,12 +74,8 @@ struct Coord${camelcase}Absolute {
7474 return static_cast<Absolute &>(*this);
7575 }
7676
77- constexpr bool operator ==(const Absolute &other) const {
78- return ${formatted_members("(this->{0} == other.{0})", join_with=" && ")};
79- }
80-
81- constexpr bool operator !=(const Absolute &other) const {
82- return !(*this == other);
77+ friend constexpr bool operator ==(const Absolute &lhs, const Absolute &rhs) {
78+ return ${formatted_members("(lhs.{0} == rhs.{0})", join_with=" && ")};
8379 }
8480};
8581
@@ -167,12 +163,8 @@ struct Coord${camelcase}Relative {
167163 return static_cast<Relative &>(*this);
168164 }
169165
170- constexpr bool operator ==(const Relative &other) const {
171- return ${formatted_members("(this->{0} == other.{0})", join_with=" && ")};
172- }
173-
174- constexpr bool operator !=(const Relative &other) const {
175- return !(*this == other);
166+ friend constexpr bool operator ==(const Relative &lhs, const Relative &rhs) {
167+ return ${formatted_members("(lhs.{0} == rhs.{0})", join_with=" && ")};
176168 }
177169};
178170
You can’t perform that action at this time.
0 commit comments