There\'s a new comparison operator <=> in C++20. However I think in most cases a simple subtraction works well:
int my_strcmp(const char *a, c
Here are some cases that subtraction won't work for:
unsigned types.operator - (perhaps because it's not meaningful - one may define an order without defining a notion of distance).I suspect this list is non-exhaustive.
Of course, one can come up with workarounds for at least #1 and #2. But the intent of operator <=> is to encapsulate that ugliness.