Closed Benzinnos closed 3 months ago
Maybe add the '<=>' operator for C++20 too?
typedef int cmp_result_type;
static cmp_result_type cmp(first_argument_type lhs, second_argument_type rhs) { if (lt(lhs, rhs)) { return -1; }
if (gt(lhs, rhs)) { return 1; }
return 0; }
Or, if we can use std::*_ordering types:
```cpp
typedef std::strong_ordering cmp_result_type;
static cmp_result_type cmp(first_argument_type lhs, second_argument_type rhs)
{
if (lt(lhs, rhs)) {
return std::strong_ordering::less;
}
if (gt(lhs, rhs)) {
return std::strong_ordering::greater;
}
return std::strong_ordering::equivalent;
}
So, are we really need spaceship operator? What the use case? We have already all 6 comparing operators. Well, the struct is called 'compare' and I thought that the three way compare would be the only one missing from the set after this change.
Review changes with SemanticDiff.