Get type from string

DarkRiDDeR via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Oct 28 10:38:43 PDT 2015


Example:

class Bob {
  static void print ()
  {
    write("str");
  }
}
string name = "Bob";
__traits(getMember, Types.getType(name), "print")();

How can you implement "Types.getType(name)"? I do not know in 
advance what can be the class names.



More information about the Digitalmars-d-learn mailing list