putting more smarts into a == b

Frank Benoit keinfarbton at googlemail.com
Sun Sep 27 01:35:27 PDT 2009


Frank Benoit schrieb:
> What about interfaces?

I mean, this is a point that annoyes me a lot in D, that interfaces
(instances) cannot be treated like objects. I cannot do

if( someiface == someobj ){ ... }

With that technique, the compiler could do a dynamic cast to Object in
place, do the null checks and then call opEquals.

Certainly, this should also work for the other methods of Objects like
toHash, toString, ...



More information about the Digitalmars-d mailing list