D-Programming-Language/phobos — pull request #1472 by monarchdodra (2013-08-12 18:30:06+00:00)
Title: introduce "toTypeTuple"

As suggested by @klickverbot in #1440, this pull supersedes `staticIota` by introducing a function that can transform any range a type tuple, including... iota.

In terms of performance, I guess it runs pretty fast. Compared to my hand written `staticIota`, `toTypeTuple!iota`, for a non release build, they both take the same ammount of time for `iota(0, 1000)`, which is more than enough (IMO). That said, for larger sizes (eg 5000), toTypeTuple's performance does deteriorate. But at this point, the sizes are crazy huge in terms of static size...

In a release build, they both take longer, but are still comparable (however, they do a wall which ices the compiler after a certain size.)

I did not add constraints, because I was unsure if it was OK to import `std.range` in `std.typetuple`, as it imports very very little.

Pinging @denis-sh who might be interested.

All feedback welcome.