Thread overview
myFunc(U:MyClass...)(U args)
Aug 21, 2008
tsalm
Aug 21, 2008
bearophile
Aug 21, 2008
tsalm
August 21, 2008
Hi all,

I've got another problem with template. I want to do this :
 void myFunc(U:MyClass...)(U args) {  }

but dmd return an error :
  found '...' when expecting ')'
  ...


Thanks in advance,
TSalm
August 21, 2008
tsalm:
> I've got another problem with template. I want to do this :
>   void myFunc(U:MyClass...)(U args) {  }

This may be related to "Typesafe Variadic Functions": http://www.digitalmars.com/d/1.0/function.html

So you may try this syntax:
void myFunc(MyClass[] args...) {  }

Bye,
bearophile
August 21, 2008
Le Fri, 22 Aug 2008 00:22:59 +0200, bearophile <bearophileHUGS@lycos.com> a écrit:

> tsalm:
>> I've got another problem with template. I want to do this :
>>   void myFunc(U:MyClass...)(U args) {  }
>
> This may be related to "Typesafe Variadic Functions":
> http://www.digitalmars.com/d/1.0/function.html
>
> So you may try this syntax:
> void myFunc(MyClass[] args...) {  }
>
> Bye,
> bearophile

sorry, i missed it.
Thanks