Thread overview | |||||
---|---|---|---|---|---|
|
August 21, 2008 myFunc(U:MyClass...)(U args) | ||||
---|---|---|---|---|
| ||||
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 Re: myFunc(U:MyClass...)(U args) | ||||
---|---|---|---|---|
| ||||
Posted in reply to tsalm | 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 Re: myFunc(U:MyClass...)(U args) | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | 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
|
Copyright © 1999-2021 by the D Language Foundation