Diff
Not logged in

Differences From Artifact [00969146488cc3dc]:

To Artifact [784e82178988239d]:


101 } 101 } 102 102 103 hash_t structuralHash(T)(T x) 103 hash_t structuralHash(T)(T x) 104 { 104 { 105 alias SC_Unqual!(T) UCT; 105 alias SC_Unqual!(T) UCT; 106 106 107 static if(is(UCT == class)) 107 static if(is(UCT == class)) 108 return (cast(UCT)x).toHash(); | 108 return (x is null ? 0 : (cast(UCT)x).toHash()); 109 else 109 else 110 static if(SC_HasGoodHash!(UCT)) 110 static if(SC_HasGoodHash!(UCT)) 111 { return typeid(UCT).getHash(&x); } 111 { return typeid(UCT).getHash(&x); } 112 else 112 else 113 static if(is(UCT T == T[])) 113 static if(is(UCT T == T[])) 114 { hash_t h; foreach(e; x) h+=structuralHash(e); return h; } 114 { hash_t h; foreach(e; x) h+=structuralHash(e); return h; } 115 else 115 else ................................................................................................................................................................................ 154 override bool opEquals(Object rhs) const /// member-by-member equality 154 override bool opEquals(Object rhs) const /// member-by-member equality 155 { 155 { 156 return opCmp(rhs) == 0; 156 return opCmp(rhs) == 0; 157 } 157 } 158 158 159 override int opCmp(Object rhs_) const /// member-by-member compare 159 override int opCmp(Object rhs_) const /// member-by-member compare 160 { 160 { 161 if( rhs_ is null ) < 162 return -1; < 163 if( auto rhs = cast(typeof(this))rhs_ ) 161 if( auto rhs = cast(typeof(this))rhs_ ) 164 { 162 { 165 foreach(i,_; this.tupleof) 163 foreach(i,_; this.tupleof) 166 { 164 { 167 static if(is(typeof(_) == struct)) 165 static if(is(typeof(_) == struct)) 168 auto c = (cast(SC_Unqual!(typeof(_)))thi 166 auto c = (cast(SC_Unqual!(typeof(_)))thi 169 else 167 else