Re: Class knowing its own Class

2010-06-30 Thread Tomek Sowiński
Dnia 30-06-2010 o 00:13:28 strtr st...@sp.am napisał(a): == Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article On Tue, 29 Jun 2010 17:59:37 -0400, strtr st...@sp.am wrote: What is the pretty way to do something like this? Class C { void makeNew() { new typeof(this);

Class knowing its own Class

2010-06-29 Thread strtr
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 } }

Re: Class knowing its own Class

2010-06-29 Thread Steven Schveighoffer
On Tue, 29 Jun 2010 17:59:37 -0400, strtr st...@sp.am wrote: What is the pretty way to do something like this? Class C { void makeNew() { new typeof(this); } } As edited... -Steve

Re: Class knowing its own Class

2010-06-29 Thread strtr
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article On Tue, 29 Jun 2010 17:59:37 -0400, strtr st...@sp.am wrote: What is the pretty way to do something like this? Class C { void makeNew() { new typeof(this); } } As edited... -Steve Whahaha! Thanks, I