On Wednesday, December 22, 2010 12:05:18 Andrej Mitrovic wrote:
> DMD 2.051 with -unittest:
> 
> import std.algorithm, std.range, std.stdio : writeln;
> 
> void main() {}
> 
> void average(double[]) { writeln("non-variadic"); }
> void average(double[]...) { writeln("variadic"); }
> 
> unittest {
>     average(1.5);   // writes "variadic"
> }

What's the confusion? You gave it a double. That matches the variadic version, 
no tthe array version. If you gave it an array of doubles, then it would match 
the array version. That seems entirely straightforward. What's surprising about 
it?

- Jonathan M Davis

Reply via email to