hasMember

Determines whether T defines a symbol member.

enum bool hasMember(T, string member);

Return Value

$(D_KEYWORD true) if T defines a symbol member, $(D_KEYWORD false) otherwise.

Examples

static struct S
{
     int member1;
     void member2()
     {
     }
     static int member3;
     static void member4()
     {
     }
}
static assert(hasMember!(S, "member1"));
static assert(hasMember!(S, "member2"));
static assert(hasMember!(S, "member3"));
static assert(hasMember!(S, "member4"));
static assert(!hasMember!(S, "member6"));

Meta