Check for presence of function

Dicebot public at dicebot.lv
Sun Mar 23 05:53:37 PDT 2014


template isSomething(T)
{
     enum isSomething =
		is(typeof(__traits(getMember, T, "doSomething")) == function)
	 && is(typeof(&__traits(getMember, T, "doSomething")) : void 
function(Unrelated*));
}


More information about the Digitalmars-d-learn mailing list