Class knowing its own Class

strtr strtr at sp.am
Tue Jun 29 14:59:37 PDT 2010


What is the pretty way to do something like this?

Class C
{
  private const char[] _name = "C";// demangling this.mangleof didn't work

  void makeNew()
  {
    mixin(`new `~_name~`();`); // the not so pretty part
  }
}


More information about the Digitalmars-d-learn mailing list