Variadic templates

nazo lovesyao at gmail.com
Thu Nov 2 05:22:17 PST 2006


hi,
I found some bugs.

void Foo(R...)(R r){
   writefln(R.length);
   writefln(r.length);
//  R[0] t;//faild
   typeof(r[0]) t;
   static if(r.length>1)
     Foo(r[1..$]);
}

R Bar(R...)(R r){
   return r;
}

void main(){
     Foo(1, 'a', 6.8);
//    writefln(Bar(1, 'a', 6.8));//faild
}



More information about the Digitalmars-d mailing list