On Wednesday, 18 November 2020 at 22:29:17 UTC, Steven Schveighoffer wrote:
How do I do something really simple for opCmp? I tried this it didn't work:

return this == other ? 0 :
    this.tupleof < other.tupleof ? -1 : 1;

std.typecons.Tuple has opCmp. So this works:

    int opCmp(S other)
    {
        import std.typecons: tuple;
        return tuple(this.tupleof).opCmp(tuple(other.tupleof));
    }

Reply via email to