Get function argument name?

JN 666total at wp.pl
Sun Mar 4 21:03:04 UTC 2018


Imagine a function like this:

void printValue(T)(string name, T value)
{
   writeln(name, " = ", value);
}

int x = 10;
printValue("x", x);

is it somehow possible to convert that printValue into a mixin or 
something, so I could do something like:

printValue(x);

and it will figure out the "x" part automatically?


More information about the Digitalmars-d-learn mailing list