Re: standard alias for a class name inside the class code?

2016-05-28 Thread dan via Digitalmars-d-learn
On Sunday, 29 May 2016 at 02:44:33 UTC, jhps wrote: On Sunday, 29 May 2016 at 00:48:20 UTC, dan wrote: Especially in a declaration like static typeof(this) make_instance( ) but also in the 'new typeof(this)'. In both cases, 'this' doesn't even exist. https://dlang.org/spec/declaration.h

Re: standard alias for a class name inside the class code?

2016-05-28 Thread jhps via Digitalmars-d-learn
On Sunday, 29 May 2016 at 00:48:20 UTC, dan wrote: Especially in a declaration like static typeof(this) make_instance( ) but also in the 'new typeof(this)'. In both cases, 'this' doesn't even exist. https://dlang.org/spec/declaration.html#Typeof it's another 'this' that has not the same

Re: standard alias for a class name inside the class code?

2016-05-28 Thread dan via Digitalmars-d-learn
On Sunday, 29 May 2016 at 00:28:13 UTC, Mithun Hunsur wrote: On Sunday, 29 May 2016 at 00:14:17 UTC, dan wrote: Is there a standard alias for a class name inside class code? Something like 'this' referring to a class instance, but referring instead to the class itself? [...] typeof(this) g

Re: standard alias for a class name inside the class code?

2016-05-28 Thread Mithun Hunsur via Digitalmars-d-learn
On Sunday, 29 May 2016 at 00:14:17 UTC, dan wrote: Is there a standard alias for a class name inside class code? Something like 'this' referring to a class instance, but referring instead to the class itself? [...] typeof(this) gets you the type of the current class. :)

standard alias for a class name inside the class code?

2016-05-28 Thread dan via Digitalmars-d-learn
Is there a standard alias for a class name inside class code? Something like 'this' referring to a class instance, but referring instead to the class itself? What i would like to do is have something like class Clas { // alias Clas THIS; <- don't want this boilerplate static THIS make_i