| template <typename T, typename U> | |
| struct pair { | |
| T first; | |
| U second; | |
| constexpr std::strong_ordering operator<=>(const pair& other) const { | |
| if (auto first_comp = first <=> other.first; first_comp != 0) { | |
| return first_comp; | |
| } else { | |
| return second <=> other.second; | |
| } | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment