query interface

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Wed Jan 21 08:02:44 PST 2009


Qian Xu wrote:
> Hi All,
> 
> can D check, whether a class A an Interface B supports?
> 
> like:
> 
>   if (supports(class_A, intf_B))

     if (is(class_A : intf_B))
tests if 'class_A' is implicitly convertible to 'intf_B'. If the first 
is a class and the second an interface, that's equivalent to the class 
implementing the interface.


More information about the Digitalmars-d-learn mailing list