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

Steven Schveighoffer schveiguy at yahoo.com
Wed Dec 22 12:56:02 PST 2010


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