string file = __FILE__ considered harmful (and solution)

Steven Schveighoffer schveiguy at yahoo.com
Wed May 30 19:56:47 UTC 2018


On 5/30/18 10:40 AM, Steven Schveighoffer wrote:
> But if we fixed the behavior that causes your idea not to work, then we 
> could probably easily define a function like so:
> 
> CallerInfo __CALLER__(string file = __FILE__, size_t line = __LINE__)
> {
>      return CallerInfo(file, line);
> }

Filed an issue so it's not forgotten:

https://issues.dlang.org/show_bug.cgi?id=18919

-Steve


More information about the Digitalmars-d mailing list