static code generation

Philippe Sigaud philippe.sigaud at gmail.com
Sun Dec 16 07:29:29 PST 2012


> it would be real nice if I there was a compile time construct for this.
> like "me" or something that would return type info inside the current
scope.

>
> class A(T) { this() { writeln(me.typeinfo.name); }
>
> would print "A(T)".
>
> (of course me is probably a bad name but just an example :)
>


You could use `typeof(this)`. It returns the static type of `this`.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20121216/c8c9d6cd/attachment.html>


More information about the Digitalmars-d-learn mailing list