Map one tuple to another Tuple of different type

Vlad Levenfeld via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 22 08:52:14 PDT 2014


I'm just confused about how static while is supposed to work 
because static foreach, to my understanding, would have to work 
by making a new type for each iteration. I say this because, 1) 
runtime foreach works like that (with type => range), and 2) 
without ctfe foreach, the only way I know of to iterate a 
typelist is to make a new type with one less element, so I 
imagine static foreach lowers to that.

I suppose its possible to make a struct with static immutable 
start and end iterators, and make new types out of advancing the 
start iterator until it was equal to the end. Seems like a step 
backward though.

Anyway my actual question is: if all values are constant at 
compile time, how would a static while loop terminate?


More information about the Digitalmars-d-learn mailing list