Variadic functions: How to pass another variadic function the variadic args?

bearophile bearophileHUGS at lycos.com
Sat Aug 3 07:58:48 PDT 2013


Gabi:

>   //HOW TO pass F1(..) the args we were called with ?


import std.stdio;

void f1(Args...)(Args args) {
     foreach (arg; args)
         arg.writeln;
}

void f2(Args...)(Args args) {
     f1(args);
}

void main() {
     f2(10, "hello", 1.5);
}


Bye,
bearophile


More information about the Digitalmars-d-learn mailing list