access enclosing type from shared static this()

"Øivind" oivind.loe at gmail.com
Wed Sep 19 12:58:52 PDT 2012


Thanks a lot both of you. The code below worked. I did not expect 
'this' to be available in the static function, but of course the 
type of 'this' is available.

> mixin template MsgMixin(T ...) {
>     shared static this() {
>         import std.stdio;
>         writeln("register " ~ typeof(this).stringof);
>     }
> }



More information about the Digitalmars-d-learn mailing list