Convenient debug printing

Per Nordlöw per.nordlow at gmail.com
Sat Feb 2 00:25:02 UTC 2019


On Saturday, 2 February 2019 at 00:06:58 UTC, Rubn wrote:
> void dbg(alias a)(string file = __FILE__, int line = __LINE__) {
> 	writeln( file, "(", line, "): ", __traits(identifier, a), " = 
> ", a );
> }

Nice!

I wasn't aware of `__traits(identifier, a)`. What role does it 
play here?

Further, can we make this variadic with respect to `alias a`?


More information about the Digitalmars-d mailing list