DIP Mir1 Draft: Variadic template parameters with the same time.

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 29 13:12:44 PDT 2016


Here's one way to do it:
------
import core.stdc.stdio;

void foo(T)(T[] a ...)
{
     printf("%d %d %d\n", a[0], a[1], a[2]);
}

void main()
{
     foo(1, 2, 3);
}
-----
C:\cbx>foo
1 2 3


More information about the Digitalmars-d mailing list