Re: Recommended way to use __FILE__/__LINE__ etc.

2020-10-22 Thread Andrey Zherikov via Digitalmars-d-learn
Thanks for all your answers!

Re: Recommended way to use __FILE__/__LINE__ etc.

2020-10-22 Thread Mathias LANG via Digitalmars-d-learn
On Thursday, 22 October 2020 at 16:03:45 UTC, H. S. Teoh wrote: On Thu, Oct 22, 2020 at 03:32:57PM +, Andrey Zherikov via Digitalmars-d-learn wrote: There are two ways how __FILE__, __LINE__ etc. can se used in function parameters: as regular parameters and as template parameters: [...] W

Re: Recommended way to use __FILE__/__LINE__ etc.

2020-10-22 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Oct 22, 2020 at 03:32:57PM +, Andrey Zherikov via Digitalmars-d-learn wrote: > There are two ways how __FILE__, __LINE__ etc. can se used in function > parameters: as regular parameters and as template parameters: [...] > What is recommended way? > What are pros/cons of each case? I d

Recommended way to use __FILE__/__LINE__ etc.

2020-10-22 Thread Andrey Zherikov via Digitalmars-d-learn
There are two ways how __FILE__, __LINE__ etc. can se used in function parameters: as regular parameters and as template parameters: void rt(string file=__FILE__, int line=__LINE__, string func=__FUNCTION__) { writeln(file,"(",line,"): ",func); } void ct(string file=__FILE__, int line=__