Remove staticIota: std_experimental_typecons#6050
Conversation
|
Thanks for your pull request, @wilzbach! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
| string r; | ||
| bool first = true; | ||
| foreach (i; staticIota!(0, num)) | ||
| foreach (i; 0 .. num) |
There was a problem hiding this comment.
It is just used to generate a string which is mixin-ed later anyways.
We could also convert args to a non-templated function, which is probably a bit faster.
There was a problem hiding this comment.
I don't feel that it makes a huge difference so I'm gonna merge.
EDIT: pending auto-tester.
There was a problem hiding this comment.
Always prefer runtime foreach (when possible - e.g. CTFE), as the compile-time/tuple/AliasSeq foreach and static foreach copy the AST of the loop body for each loop iteration, thereby making the compilation slower and requiring more memory.
No description provided.