double -> double[]... | feature or bug?

Andrej Mitrovic andrej.mitrovich at gmail.com
Wed Dec 22 13:06:41 PST 2010


Oooh. That cought me off guard, sorry.

Thanks Steve.

On 12/22/10, Steven Schveighoffer <schveiguy at yahoo.com> wrote:
> On Wed, 22 Dec 2010 15:46:01 -0500, Andrej Mitrovic
> <andrej.mitrovich at gmail.com> wrote:
>
>> I thought the variadic version would only take this type:
>>
>> average([1.5], [2.5]);
>>
>> So a variable number of *array* of doubles, not a variable number of
>> doubles.
>
> No, that's not it.
>
> T[] arg... is a typesafe variadic argument of type T.  The docs describe
> it here: http://www.digitalmars.com/d/2.0/function.html (search for
> typesafe)
>
> Hopefully that helps?
>
> If you were looking for something to accept your above args, it would be:
>
> double[][] arg...
>
> -Steve
>


More information about the Digitalmars-d-learn mailing list