Thread overview | |||||
---|---|---|---|---|---|
|
March 02, 2004 Interfaces problem | ||||
---|---|---|---|---|
| ||||
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 Re: Interfaces problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vathix | 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 Re: Interfaces problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to Justin Henzie | 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
|
Copyright © 1999-2021 by the D Language Foundation