Type and interface checking

Myron Alexander someone at somewhere.com
Thu Aug 30 08:20:34 PDT 2007


Hans-Eric Grönlund wrote:
> Hello!
> 
> How can I check if an object is of a certain class, or implements a certain interface?
> 
> Thanks 
> 
> Hans-Eric Grönlund
> http://www.hans-eric.com/

You can use the cast operator to determine if something can be cast to a 
type. See attached example.

Regards,

Myron.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: main.d
Url: http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20070830/d8f466a9/attachment.txt 


More information about the Digitalmars-d-learn mailing list