how do I check if a member of a T has a member ?

Laeeth Isharc via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Sep 13 10:24:19 PDT 2015


On Sunday, 13 September 2015 at 17:09:57 UTC, wobbles wrote:
> Use __traits(compiles, date.second)?


Thanks.

This works:

static if (__traits(compiles, { T bar; bar.date.hour;}))
		pragma(msg,"hour");
	else
		pragma(msg,"nohour");
	


More information about the Digitalmars-d-learn mailing list