OpEquals and Interfaces

Christoph Mueller ruunhb at googlemail.com
Tue Apr 13 14:27:20 PDT 2010


> If you are using D2, there is a workaround:
>
> interface I
> {
> final bool opEquals(I other)
> {
> Object me = cast(Object)this;
> Object they = cast(Object)other;
> return equals(me, they);
> }
> }
>
> But it would be nice if the compiler did this automatically. There are
> other things that suck because interfaces are not assumed to be derived
> from Object.

What kind of things also doesn't work relating to interfaces and Object ?

-- 
ruunhb [AT] googlemail.com
http://www.ruuns.de/blog



More information about the Digitalmars-d mailing list