On 8/3/12, Zhenya <zh...@list.ru> wrote: > snip You mean how to extract the variable name?
import std.stdio; template T(alias a) { enum string T = __traits(identifier, a); } void main(string[] argv) { char f = 'a'; writeln(T!f); // writes 'f' }
On 8/3/12, Zhenya <zh...@list.ru> wrote: > snip You mean how to extract the variable name?
import std.stdio; template T(alias a) { enum string T = __traits(identifier, a); } void main(string[] argv) { char f = 'a'; writeln(T!f); // writes 'f' }