On Friday, 8 May 2015 at 21:56:56 UTC, Brian Schott wrote:
Allowing "template Tem(alias Args ...)" syntax would let me trace multiple variables at once.

Actually, this already works:

void traceVars(alias T, U...)() {
    import std.stdio : writeln;
    writeln(T.stringof, ": ", T);
    static if (U.length > 0) {
        traceVars!(U);
    }
}

void main(string[] args) {
    auto argslength = args.length;
    auto args0 = args[0];

    traceVars!(args, argslength, args0);
}

Sadly, the ... syntax precludes the use of __LINE__ and __FILE__. :(

Reply via email to