Skip to content

Commit

Permalink
Added missing ordering operators.
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepy-monax committed Apr 15, 2024
1 parent 8c556c3 commit b600649
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/ce-stdcpp/compare
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ struct partial_ordering {
return v._value <= 0;
}

friend bool operator==(partial_ordering v, partial_ordering w) {
return v._value == w._value;
}

private:
int _value;
};
Expand Down Expand Up @@ -90,6 +94,10 @@ struct weak_ordering {
friend bool operator>(nullptr_t, weak_ordering v) { return 0 > v._value; }
friend bool operator>=(nullptr_t, weak_ordering v) { return 0 >= v._value; }

friend bool operator==(weak_ordering v, weak_ordering w) {
return v._value == w._value;
}

private:
int _value;
};
Expand Down Expand Up @@ -130,6 +138,10 @@ struct strong_ordering {
friend bool operator>(nullptr_t, strong_ordering v) { return 0 > v._value; }
friend bool operator>=(nullptr_t, strong_ordering v) { return 0 >= v._value; }

friend bool operator==(strong_ordering v, strong_ordering w) {
return v._value == w._value;
}

private:
int _value;
};
Expand Down

0 comments on commit b600649

Please sign in to comment.