Is old style compile-time foreach redundant?

Stefan Koch uplink.coder at googlemail.com
Sun Jan 7 02:17:02 UTC 2018


On Sunday, 7 January 2018 at 01:08:44 UTC, H. S. Teoh wrote:
> On Sun, Jan 07, 2018 at 12:55:27AM +0000, Stefan Koch via 
> Digitalmars-d-learn wrote:
>> On Saturday, 6 January 2018 at 23:25:58 UTC, Ali Çehreli wrote:
>> > Is 'static foreach' sufficient for all needs or is there any 
>> > value for regular foreach over compile-time sequences?
> [...]
>> No it's not.
>> When you can use the old style do so. Since it puts less 
>> stress on the
>> compiler in the general case.
>
> Really? Based on a recent post by Jonathan Davis, the new 
> static foreach actually runs faster in certain use cases.
>
>
> T

That might be true.
If you are hitting some constant factor, however the big-o for 
static foreach is worse then for tuple foreach.


More information about the Digitalmars-d-learn mailing list