www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - myFunc(U:MyClass...)(U args)

reply tsalm <tsalm free.fr> writes:
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
Aug 21 2008
parent reply bearophile <bearophileHUGS lycos.com> writes:
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
Aug 21 2008
parent tsalm <tsalm free.fr> writes:
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
Aug 21 2008