On Monday, 8 June 2015 at 21:14:46 UTC, Jonathan M Davis wrote:
I would assume that it would be pretty much the same as doing

foreach(T; TypeTuple!(...))
{
    ...
}

except that you're not forced to shove everything in a TypeTuple.

- Jonathan M Davis

If that was the case, A library solution for converting a compile-time range to a TypeTuple would have sufficed(http://dpaste.dzfl.pl/7eb30f5e1156 - this compiles in 2.67).

The problem with regular `foreach` over type tuple is that declarations inside the foreach's body are invisible from the outside. If `static foreach` had this limitation, Andrei's example wouldn't work since `trace` would be local to the body of the `static foreach`. This essentially renders the main usecase of this feature(declaring stuff) and leaves us with a loop unrolling optimization...

Reply via email to