Check the class of objects

Mael mael.primet at gmail.com
Thu Jun 5 09:53:37 PDT 2008


> What's wrong with:
> 
> if(isByteImage(u))
> { do something; }
> ...
> 
> Either way, you still need the if-else block to determine what the image is 
> at runtime.

Well, actually the point is that the action "do something" is consistent accross images except when trying to access data (compare bytes/floats/value/triples), and using a run time if inside the loops would be unefficient, that's why I want to only use static if in the loop, but still share most of the code since it's truly redundant 

 


More information about the Digitalmars-d-learn mailing list