On Tuesday, 18 April 2017 at 13:48:57 UTC, Stanislav Blinov wrote:
There's a much more concise workaround, both in code written and generated ;)

import std.stdio;

template func(string file = __FILE__, int line = __LINE__)
{
    auto func(T...)(auto ref T args)
    {
        writeln("called func with ", T.length, " args at ",
                file, ":", line);
    }
}

void main()
{
    func();
    func(1, 2, 3);
}

Very nice. Thank you!

Reply via email to