On 20.02.2018 01:57, Timothee Cour wrote:
On Mon, Feb 19, 2018 at 4:05 PM, Timon Gehr via Digitalmars-d
<digitalmars-d@puremagic.com> wrote:
On 20.02.2018 00:53, Timothee Cour wrote:

Sure! Also, this:

void main(string[] args){
     enforce(args.length==5, "Invalid args");
     auto (infile, colname, repl, outfile) = args[1..5].unpack;
     // ...
}


how does that latter example work?


IFTI. unpack could have the following overload:

auto unpack(size_t n,T)(T[n] args){
return mixin("tuple("~iota(n).map!(i=>text("args[",i,"]")).join(",")~")");
}

Reply via email to