Capturing __FILE__ and __LINE in a variadic templated function

anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Nov 1 15:36:14 PST 2015


On 01.11.2015 23:49, Adam D. Ruppe wrote:
> Yeah, just make the other args normal runtime instead of template:

Or make it two nested templates:

template show(T ...)
{
     void show(string file = __FILE__, uint line = __LINE__,
         string fun = __FUNCTION__)()
     {
         ...
     }
}


More information about the Digitalmars-d-learn mailing list