Can a call to pragma(msg, __FILE__, ...) be mixin templatized?

Per Nordlöw per.nordlow at gmail.com
Mon Aug 17 21:18:41 UTC 2020


I'm using

     pragma(msg, __FILE__, "(", __LINE__, ",1): Debug: ", "A 
useful debug message");

to print compile-time information formatted as standard compiler 
diagnostics.

These are picked up by Emacs Flycheck and overlayed in the editor 
and listen in the *Flycheck errors* buffer. Very convenient. When 
I want to get the type of something at compile-time.

In order to not having to repeat oneself I'm now looking for a 
way to extract this into a `mixin template`. Is this possible 
somehow and still preserve the instantiation site values of 
`__FILE__` and `__LINE__`?


More information about the Digitalmars-d-learn mailing list