On 19/02/2015 14:59, John Colvin wrote:
On Thursday, 19 February 2015 at 13:52:29 UTC, Nick Treleaven wrote:
On 19/02/2015 04:38, thedeemon wrote:
int x, y, z, age;
string name;
let (name, age) = getTuple(); // tuple
let (x,y,z) = argv[1..4].map!(to!int); // lazy range
let (x,y,z) = [1,2,3]; // array
SomeStruct s;
let (s.a, s.b) = tuple(3, "piggies");
Alternatively std.typetuple.TypeTuple can be used instead of let
not for ranges and arrays though
Yes, but `tuple` overloads could be added for those. Tuple already
supports construction from a static array:
int a, b;
TypeTuple!(a, b) = Tuple!(int, int)([3, 4]);