www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Reference parent type

reply "Frustrated" <c1514843 drdrb.com> writes:
Suppose I have

class A
{
     mixin t!A;
}

is there a way to replace the mixin template's dependence on the
class name?

e.g.,

class A
{
     mixin t!This; // This turns in to A
}

(so, for example, renaming the above class only has to rename one
place instead of two)
Jan 30 2014
parent "Stanislav Blinov" <stanislav.blinov gmail.com> writes:
On Thursday, 30 January 2014 at 09:03:17 UTC, Frustrated wrote:

mixin t!(typeof(this))
Jan 30 2014