std.mixins

Nick Sabalausky a at a.a
Tue Aug 31 13:00:11 PDT 2010


"Lutger" <lutger.blijdestijn at gmail.com> wrote in message 
news:i5jmlc$13li$1 at digitalmars.com...
> Nick Sabalausky wrote:
>
>> "Lutger" <lutger.blijdestijn at gmail.com> wrote in message
>> news:i5jiap$rvb$1 at digitalmars.com...
>>> dsimcha wrote:
>>>>It can still be useful if you also change the loop body a
>>>> little, for example using multiple accumulators to increase instruction
>>>> level
>>>> parallelism,
>>>> but this is hard to write generically.  I can't think of a way to write
>>>> such a
>>>> mixin such that it would be both generic and useful.
>>>
>>> Probably not for performance, but as a utility for metaprogramming I 
>>> find
>>> it
>>> sometimes convenient.
>>
>> Isn't performance the whole point of loop unrolling? What other use could
>> there be?
>
> I should have called it 'static foreach'
>

Ok, but I guess I still don't see how that relates to a mixin for loop 
unrolling...? You seemed to be implying that you'd find a mixin for loop 
unrolling useful for something other than performace. Do you just mean using 
it like a "static foreach" back *before* "static foreach" was added?




More information about the Digitalmars-d mailing list