Re: Make a type tuple from an array

2015-04-11 Thread John Colvin via Digitalmars-d-learn
On Friday, 10 April 2015 at 22:55:23 UTC, Nordlöw wrote: On Friday, 10 April 2015 at 15:36:42 UTC, John Colvin wrote: if (TL.length == 1 isInputRange!(typeof(TL[0]))) Why not use isStaticArray instead of isInputRange here? Because that would be completely different. Static arrays aren't

Re: Make a type tuple from an array

2015-04-11 Thread Dicebot via Digitalmars-d-learn
On Saturday, 11 April 2015 at 09:05:19 UTC, Nordlöw wrote: On Saturday, 11 April 2015 at 07:18:26 UTC, John Colvin wrote: Why not use isStaticArray instead of isInputRange here? Because that would be completely different. Static arrays aren't even input ranges... Ahh, my mistake. Could

Re: Make a type tuple from an array

2015-04-11 Thread Nordlöw
On Saturday, 11 April 2015 at 07:18:26 UTC, John Colvin wrote: Why not use isStaticArray instead of isInputRange here? Because that would be completely different. Static arrays aren't even input ranges... Ahh, my mistake. Could somebody explain when this feature is needed?

Re: Make a type tuple from an array

2015-04-11 Thread Artur Skawina via Digitalmars-d-learn
On 04/10/15 17:36, John Colvin via Digitalmars-d-learn wrote: On Friday, 10 April 2015 at 15:13:54 UTC, Marc Schütz wrote: Is there a way to turn an array (known at compile time) into a TypeTuple? For input ranges in general: import std.range : isInputRange; template TypeTupleOf(TL...)

Re: Make a type tuple from an array

2015-04-11 Thread John Colvin via Digitalmars-d-learn
On Saturday, 11 April 2015 at 09:23:11 UTC, Dicebot wrote: On Saturday, 11 April 2015 at 09:05:19 UTC, Nordlöw wrote: On Saturday, 11 April 2015 at 07:18:26 UTC, John Colvin wrote: Why not use isStaticArray instead of isInputRange here? Because that would be completely different. Static

Re: Make a type tuple from an array

2015-04-10 Thread Nordlöw
On Friday, 10 April 2015 at 15:36:42 UTC, John Colvin wrote: if (TL.length == 1 isInputRange!(typeof(TL[0]))) Why not use isStaticArray instead of isInputRange here?