On Fri, Apr 3, 2009 at 5:20 PM, Andrei Alexandrescu
<seewebsiteforem...@erdani.org> wrote:
> Jarrett Billingsley wrote:
>>
>> On Fri, Apr 3, 2009 at 10:38 AM, Eljay <el...@adobe.com> wrote:
>>
>>> Alas, I'm not sure how to pass the variadic arguments through to another
>>> variadic function, with this
>>> signature:
>>> void perform(...)
>>
>> You can't.  D's varargs suck.
>
> Of course you can. Where did that come from?
>
> void foo(T...)(T args) { bar(args); }
> void bar(T...)(T args) {  foreach (a; args) writeln(a); }
>
> void main()
> {
>    foo(3, 4.5);
> }
>
> prints:
>
> 3
> 4.5
>
>
> Andrei
>

That's not a D vararg, it's a variadic template!

I've made proposals to allow this properly (without templates) before
so I'm not going to waste time on that again...

It's a silly limitation IMHO.

Reply via email to