Thread overview
Interfaces problem
Mar 02, 2004
Vathix
Mar 04, 2004
Justin Henzie
Mar 04, 2004
Sean Kelly
March 02, 2004
Should this cast work? the assertion fails:


interface IFoo { }
class Foo: IFoo { }

int main()
{
   IFoo f = new Foo;
   assert(cast(Foo)f !== null);
   return 0;
}


-- 
Christopher E. Miller
March 04, 2004
is the !== deliberate or a typo?


In article <c21jug$1dhe$1@digitaldaemon.com>, Vathix says...
>
>Should this cast work? the assertion fails:
>
>
>interface IFoo { }
>class Foo: IFoo { }
>
>int main()
>{
>    IFoo f = new Foo;
>    assert(cast(Foo)f !== null);
>    return 0;
>}
>
>
>-- 
>Christopher E. Miller


March 04, 2004
Justin Henzie wrote:

> is the !== deliberate or a typo?

Deliberate.  D uses a few odd comparison operators to differentiate whether the objects themselves are being compared or jus the references to them.

Sean