On 26 March 2012 10:34, bls <bizp...@orange.fr> wrote: > > (T) (T[] t) AND (T) (T t) seems not to work.
Ok, so looking here: http://dlang.org/function.html, I have determined that, if you are using Variant arrays (though I'm not sure if you can do that using literals...) you can use the syntax from this example: int test() { return sum(1, 2, 3) + sum(); // returns 6+0 } int func() { int[3] ii = [4, 5, 6]; return sum(ii); // returns 15 } int sum(int[] ar ...) { int s; foreach (int x; ar) s += x; return s; } You'll probably need to do some experimentation to figure out how Variant fits into that properly, but it shouldn't be too hard. Also, remember that opDispatch takes the name of the function as the last parameter, so watch out for that. -- James Miller