On 11/19/20 6:12 AM, Steven Schveighoffer wrote:
On 11/18/20 6:06 PM, ag0aep6g wrote:
int opCmp(S other) { import std.typecons: tuple; return tuple(this.tupleof).opCmp(tuple(other.tupleof)); }Ah, excellent solution! I hadn't thought of that. -Steve
That's what I use as well.S can be replaced with something like 'typeof(this)' (or perhaps 'ref const(typeof(this))' and throw some inout in there :) ) and the whole thing can be mixed-in whereever needed.
Ali
