Diff
Not logged in

Differences From Artifact [c96de2738d81e418]:

To Artifact [d1500d1519df592c]:


126 126 } 127 127 128 128 override int opCmp(Object rhs_) const /// member-by-member compare 129 129 { 130 130 if( auto rhs = cast(typeof(this))rhs_ ) 131 131 { 132 132 foreach(i,_; this.tupleof) 133 - if(auto c = typeid(_).compare(&this.tupleof[i],&rhs.tupleof[i])) 134 - return c; 133 + if( this.tupleof[i] != rhs.tupleof[i] ) { 134 + auto a = this.tupleof[i]; 135 + auto b = rhs.tupleof[i]; 136 + return cast(SC_Unqual!(typeof(a)))a < b ? -1 : +1; 137 + } 138 +// if(auto c = typeid(_).compare(&this.tupleof[i],&rhs.tupleof[i])) 139 +// return c; 135 140 return 0; 136 141 } 137 142 assert(false, sprintf!"Cannot compare %s with %s"(typeid(this), typeid(rhs_))); 138 143 } 139 144 } 145 + 146 +alias std.traits.Unqual SC_Unqual; 140 147 141 148 unittest 142 149 { 143 150 class Temp 144 151 { 145 152 int x; 146 153 string y;