variadic args

Aarti_pl aarti at interia.pl
Mon Dec 11 08:47:12 PST 2006


Endea napisał(a):
> Aarti_pl kirjoitti:
>> I just would wish myself that Walter will add support for templatized 
>> constructors to achieve following:
>>     # printVariadic(new Any(4), new Any("Yet another text"[]), new 
>> Any(3.14)); // it doesn't work now...
>>
> 
> Would this work?
> 
> static Any opCall(T)(T t)
> {
>   return (new Any()).assign(t);
> }

Yes, it should work...

BR
Marcin Kuszczak


More information about the Digitalmars-d-learn mailing list