if static member then call

Engine Machine via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Aug 13 12:15:08 PDT 2016


On Saturday, 13 August 2016 at 18:42:50 UTC, Cauterite wrote:
> On Saturday, 13 August 2016 at 18:34:43 UTC, Engine Machine 
> wrote:
>>     static if (hasStaticMember!(T, "foo"))
>
> Here I suspect you're looking for this:
> __traits(isStaticFunction, __traits(getMember, T, "foo"))

Thanks.

It needs to be something like

static if (hasMemeber!(T, "foo") && __traits(isStaticFunction, 
__traits(getMember, T, "foo")))




More information about the Digitalmars-d-learn mailing list