How to create a function that behaves like std.stdio.writeln but prepends output with __FILE__:_LINE_

Dennis dkorpel at gmail.com
Tue Jan 25 12:27:16 UTC 2022


On Tuesday, 25 January 2022 at 12:11:01 UTC, JG wrote:
> Any ideas how one can achieve what is written in the subject 
> line?

```D
void f(T...)(auto ref T args, string file = __FILE__, int line = 
__LINE__)
{
     writeln(file, ":", line, ": ", args);
}
```


More information about the Digitalmars-d-learn mailing list