Is it possible to make the following definition
void show(alias T, string file = __FILE__, uint line = __LINE__,
string fun = __FUNCTION__)()
{
import std.stdio: writeln;
try { debug writeln(file, ":",line, ":" /* , ": in ",fun */,
" debug: ", T.stringof, ":", T); }
catch (Exception) { }
}
used as
unittest
{
int x = 11;
int y = 12;
int z = 13;
show!x;
show!y;
show!z;
}
variadic so that it, instead, can be called as
unittest
{
int x = 11;
int y = 12;
int z = 13;
show!(x,y,z);
}
and still capture current file, line and function?