is `allMembers` useless for modules?

FeepingCreature feepingcreature at gmail.com
Mon Jan 14 09:02:25 UTC 2019


Oh, here's a fun one:

import std.stdio;

static foreach (member; __traits(allMembers, std))
{
     static assert(__traits(hasMember, std, member));
}

You'd think that __traits(allMembers) would imply 
__traits(hasMember). That would be a dangerous mistake.


More information about the Digitalmars-d mailing list