let (x,y) = ...

Nick Treleaven via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Thu Feb 19 09:25:25 PST 2015


On 19/02/2015 17:00, Nick Treleaven wrote:
>>> 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.

Or not - the length isn't known at compile-time.

> Tuple already
> supports construction from a static array:
>
>      int a, b;
>      TypeTuple!(a, b) = Tuple!(int, int)([3, 4]);

I'm hacking std.typecons so this does work:

     TypeTuple!(a, b) = [4, 5].tuple;



More information about the Digitalmars-d-announce mailing list