@@ -128,16 +128,23 @@ override int opCmp(Object rhs_) const /// member-by-member compare { if( auto rhs = cast(typeof(this))rhs_ ) { - foreach(i,_; this.tupleof) - if(auto c = typeid(_).compare(&this.tupleof[i],&rhs.tupleof[i])) - return c; + foreach(i,_; this.tupleof) + if( this.tupleof[i] != rhs.tupleof[i] ) { + auto a = this.tupleof[i]; + auto b = rhs.tupleof[i]; + return cast(SC_Unqual!(typeof(a)))a < b ? -1 : +1; + } +// if(auto c = typeid(_).compare(&this.tupleof[i],&rhs.tupleof[i])) +// return c; return 0; } assert(false, sprintf!"Cannot compare %s with %s"(typeid(this), typeid(rhs_))); } -} +} + +alias std.traits.Unqual SC_Unqual; unittest { class Temp