string file = __FILE__ considered harmful (and solution)

bauss jj_1337 at live.dk
Wed May 30 11:59:05 UTC 2018


On Wednesday, 30 May 2018 at 08:27:16 UTC, FeepingCreature wrote:
> There's a very common idiom where in order to report line 
> numbers of an error or a log line at the callsite of a 
> function, you pass __FILE__ and __LINE__ as default parameters:
>
> [...]

void foo(string file = __FILE__, size_t line = __LINE__)(string 
msg);

Wouldn't this solve it?



More information about the Digitalmars-d mailing list