[Issue 2599] Two variadic parameters should be accepted

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jan 25 06:54:19 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2599





------- Comment #3 from smjg at iname.com  2009-01-25 08:54 -------
> When instantiated explicitly, all explicit arguments are eaten by 
> T1.  This is the purpose of the pattern: pass some explicit 
> arguments, then deduce some more implicitly.

In the current template system, a template is instantiated either implicitly or
explicitly - no in-between.  At least, AIUI, the only exception is when one
template argument is deduced from another, as in

    template temp(T : U[], U) {
        const string temp = "array of " ~ U.stringof;
    }

    pragma(msg, temp!(int[]));

To allow part-explicit, part-implicit template instantiations like you're
asking for would be in itself a change in the language that must come first.

> Currently this is possible, but only with one ellipsis.

I'm not sure what you mean by this....

BTW your workaround can be written more simply:

    template f(T1...) {
        void f(T2...)(T2 args) { ... }
    }


-- 



More information about the Digitalmars-d-bugs mailing list