Runtime class check

funog funog at ifrance.com
Fri Apr 20 09:35:02 PDT 2007


BCS Wrote:

> funog wrote:
> > Is there a way to have a runtime class check other than
> > if(cast(X)y)
> > ( It just does not look really "nice" to me ^^)
> > 
> 
> Unless you are not going to use it as the type you are checking for 
> what's wrong with that (or this)
> 
> if(auto x = cast(X) y)
> {
>   // use x
> }

You are right, it's nice. But i guess it means the answer to my question is "no" ;)


More information about the Digitalmars-d-learn mailing list