On Saturday, 3 March 2012 at 01:46:05 UTC, Andrej Mitrovic wrote:
Well, there is a way but it might wreak havoc on your object
size since it will instantiate a lot of templates.
Since some time last year, it works on all functions, just
use regular default parameters:
// test9.d
import std.stdio;
void a(string file = __FILE__, int line = __LINE__) {
writeln("called from ", file, ":", line);
}
void main() {
a;
a;
a;
}
//
dmd test9
test9
called from test9.d:8
called from test9.d:9
called from test9.d:10