Capturing __FILE__ and __LINE in a variadic templated function

Nordlöw via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Nov 2 23:35:40 PST 2015


On Tuesday, 3 November 2015 at 06:14:14 UTC, Jonathan M Davis 
wrote:
> You should pretty much never use __FILE__ or __LINE__ as 
> template arguments unless you actually need to. The reason is 
> that it will end up creating a new instantiation of the 
> template pretty much every time that it's used, which is going 
> to be mean a _lot_ of extra code bloat if you use the template 
> much. And in some, rare circumstances that may be exactly what 
> you want. But it almost never is.
>
> - Jonathan M Davis

So why is this pattern is used all over std.experimental.logger?


More information about the Digitalmars-d-learn mailing list