rtti cast
terranium
spam at here.lot
Thu May 8 11:44:16 PDT 2008
Jarrett Billingsley Wrote:
> > yeah, try something else, hide the bug :)
> > ...
> > ...efficient bugmaker.
>
> I _really_ don't understand where you're coming from here. I'd be
> interested to see some example of code where an invalid downcast were a bug
> and where a failed cast _should_ throw an exception. I've only ever used
> downcasts in D as a replacement for Java's "instanceof", where it's just a
> simple typecheck.
void GetNodes()
{
auto obj = Parser.GetNextObject();
MyList.Add(cast(INode)obj);
}
More information about the Digitalmars-d
mailing list