compare.h 306 B

123456789101112131415
  1. #pragma once
  2. #include <compare>
  3. namespace std {
  4. template <typename T> std::strong_ordering operator<=>(T const & lhs, T const & rhs) {
  5. if (lhs < rhs) {
  6. return std::strong_ordering::less;
  7. }
  8. if (lhs > rhs) {
  9. return std::strong_ordering::greater;
  10. }
  11. return std::strong_ordering::equal;
  12. }
  13. }