Re: foreach vs static foreach on compile time tuples

2025-08-27 Thread monkyyy via Digitalmars-d-learn
On Wednesday, 27 August 2025 at 10:29:20 UTC, Steven Schveighoffer wrote: Static foreach vs foreach on the same ct sequence should be equal performance. All alias foreach's must be on an aliasSeq that must exist, *thats a downside* Op didnt seem to be thinking about ct bigO so presumably m

Re: foreach vs static foreach on compile time tuples

2025-08-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On Tuesday, 26 August 2025 at 18:48:47 UTC, monkyyy wrote: ```d #!opend -unittest -main -run app.d bool isEvenImpl(int I)()=>! I%2; enum cases=1; import std.range; bool isEven(int i){ switch(i){ static foreach(I;0..cases){ //foreach(I;enumlist!(iota(cas

Re: foreach vs static foreach on compile time tuples

2025-08-26 Thread Nick Treleaven via Digitalmars-d-learn
On Tuesday, 26 August 2025 at 18:48:47 UTC, monkyyy wrote: Since enum foreach is being deleted and nore properly implimented (ugh that not why I report bugs; to remove features) No. 'enum foreach' never did anything different from normal `foreach`. The new error stops anyone from thinking it d

Re: foreach vs static foreach on compile time tuples

2025-08-26 Thread monkyyy via Digitalmars-d-learn
On Sunday, 24 August 2025 at 08:35:57 UTC, Per Nordlöw wrote: Which are the pros and cons of foreach vs static foreach on a compile time tuple in D in terms of compiler performance and resource usage? Does static foreach generate more ast duplications? Since enum foreach is being deleted and

Re: foreach vs static foreach on compile time tuples

2025-08-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, August 24, 2025 2:35:57 AM Mountain Daylight Time Per Nordlöw via Digitalmars-d-learn wrote: > Which are the pros and cons of foreach vs static foreach on a > compile time tuple in D in terms of compiler performance and > resource usage? Does static foreach generate more ast > duplicati

Re: foreach vs static foreach on compile time tuples

2025-08-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, August 24, 2025 6:30:08 AM Mountain Daylight Time David T. Oxygen via Digitalmars-d-learn wrote: > On Sunday, 24 August 2025 at 08:35:57 UTC, Per Nordlöw wrote: > > Which are the pros and cons of foreach vs static foreach on a > > compile time tuple in D in terms of compiler performance

Re: foreach vs static foreach on compile time tuples

2025-08-24 Thread David T. Oxygen via Digitalmars-d-learn
On Sunday, 24 August 2025 at 08:35:57 UTC, Per Nordlöw wrote: Which are the pros and cons of foreach vs static foreach on a compile time tuple in D in terms of compiler performance and resource usage? Does static foreach generate more ast duplications? -- Yes, it will make the compile-time lo

foreach vs static foreach on compile time tuples

2025-08-24 Thread Per Nordlöw via Digitalmars-d-learn
Which are the pros and cons of foreach vs static foreach on a compile time tuple in D in terms of compiler performance and resource usage? Does static foreach generate more ast duplications?