Unrolling loops
downs
default_357-line at yahoo.de
Mon Mar 10 17:35:39 PDT 2008
Simen Kjaeraas wrote:
> Is it possible to unroll loops in D2.0? I have a templated struct with a static array with length set through a template parameter. Does that get automatically unrolled with 4 elements (I doubt it), do I have to use some magic string mixin, or could I fix this with tuples and their automatic loop unrolling?
>
> Actually, that latter one is worth a question of its own. Can I convert a static array into a tuplem and if so, how?
Use a union :)
union TupleAndStaticArrayTest {
uint[4] whee;
Repeat!(uint, 4) whoo;
}
>
> -- Simen
More information about the Digitalmars-d-learn
mailing list