hidden passing of __FILE__ and __LINE__ into function

Dmitry via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Apr 17 03:40:05 PDT 2017


On Monday, 17 April 2017 at 10:30:35 UTC, Basile B. wrote:
> when used as template value parameter, __FILE__ and 
> __LINE__evaluate to the file and line of the call site. So help 
> yourself ans use something like this:
>
> void error(string f = __FILE__, int l = __LINE__)(string msg){}

Thank you, Basile, it works perfect.


More information about the Digitalmars-d-learn mailing list