On Sunday, 13 September 2015 at 17:24:20 UTC, Laeeth Isharc wrote:
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");
can't you use 'hasMember' (either with __traits() or std.traits.hasMember)? It's more idiomatic than checking if it's compilable.