Comparing TypeInfo_Pointer

Chris Miller chris at dprogramming.com
Mon Feb 20 15:05:27 PST 2006


Comparing TypeInfo_Pointer`s doesn't work as expected because it uses  
TypeInfo's opEquals/opCmp which use the classinfo.name, but  
TypeInfo_Pointer (and _Array / friends) have their 'next' member with the  
actual classinfo name, so it's comparing the wrong data.

e.g. even though typeid(int*).toString() and typeid(double*).toString()  
print out correct strings, they come out equal when comparing them because  
it's comparing the TypeInfo_Pointer strings and not the actual pointer  
types they refer to.



More information about the Digitalmars-d-bugs mailing list