Make a type tuple from an array
John Colvin via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sat Apr 11 03:13:48 PDT 2015
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 arrays
>>> aren't even input ranges...
>>
>> Ahh, my mistake.
>>
>> Could somebody explain when this feature is needed?
>
> Code generation. Doing string mixin for each element of the
> array (won't work with plain foreach over array as it does
> runtime iteration)
Generating case statements is a nice example use that doesn't
(necessarily) involve string mixins.
More information about the Digitalmars-d-learn
mailing list