query interface

Trass3r mrmocool at gmx.de
Wed Jan 21 08:32:51 PST 2009


Qian Xu schrieb:
> Thanks. Could you tell me, how to make a function for this? I do not know
> how to pass an Interface as parameter.
> 
> like
>   bool supports(T)(T obj, interface_type t)
>   {
>     return (is(obj : t));
>   }

Guess something like

bool supports(T, I) (T obj)
{
	return (is(obj : I));
}

should do it.


More information about the Digitalmars-d-learn mailing list