__traits with alias

sigod via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed May 7 17:21:11 PDT 2014


void registerAll(alias module_)()
{
      foreach (m; __traits(derivedMembers, module_)) {
          regInner!(__traits(getMember, module_, m)); // compiles

          alias a = __traits(getMember, module_, m); // fails
          //Error: basic type expected, not __traits
          //Error: semicolon expected to close alias declaration
      }
}

void regInner(alias T)()
{
      // ...
}

Is this a bug or I've missed something?


More information about the Digitalmars-d-learn mailing list