On Thursday, 31 October 2013 at 10:18:25 UTC, Uplink_Coder wrote:
Maybe I shuold be more specific :
for now It's:
T[] arr = makeArray!(T,U)([some,instances,of,U]);
but I would like it to be:
auto arr = makeArray!(T)([some,instances,of,U]);
void foo(T,U)(U arg){}
int a;
foo!(double)(a); //U is inferred as int
void bar(T,U)(U[] arg){}
long[] b;
foo!(double)(b); //U is in inferred as long
However, be aware that you can't pass mutable or const data as an
immutable argument. Perhaps the signature that would work better
for you would be
T[] makeArray(T,U)(const U[] paramArray)