Hello, is there a way of getting CT info of a class' children?

If no, what do you think of a new feature for DMD: template this static ctors/dtors:

class A
{
    static this(this T)()
    {
        writeln("static this(", T.stringof, ")");
    }
}

class B : A
{

}

would output:
static this(A)
static this(B)

how it works:
when instantiating (shared) static ctors/dtors of class C, DMD will look for template_this_static_ctors/dtors in C, and all of it's superclasses, instantiating each with C as this, and adding such instances to C as regular static ctors/dtors.

Reply via email to