Runtime class check

BCS BCS at pathlink.com
Fri Apr 20 09:12:23 PDT 2007


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
}


More information about the Digitalmars-d-learn mailing list