What about this?

------
struct EndOfArgs { }
EndOfArgs eoa;

void func(string s, EndOfArgs _ = eoa,
        string file = __FILE__, size_t line = __LINE__)
{
        import std.stdio;
        writefln("%s:%d: msg=%s", file, line, s);
}

void main() {
        func("hello");
        func("there");
}
------


Basically, use a dummy empty struct to differentiate between real
arguments and context info.


T

-- 
Don't drink and derive. Alcohol and algebra don't mix.

Reply via email to