On Friday, 6 May 2016 at 05:20:50 UTC, Ali Çehreli wrote:
On 05/05/2016 10:00 PM, Erik Smith wrote:
Is there an existing way to adapt a parameter pack to an input
range? I
would like to construct an array with it. Example:
void run(A...) (A args) {
Array!int a(toInputRange(args));
}
Just initialize an array with the arguments:
void run(A...) (A args) {
writeln([args]);
}
Ali
That's allocating a dynamic array though, right? It seems like
there should be a non-GC adaptor for this purpose (especially
since I'm using std.container.array).
erik