static foreach direct use of variables
HappyDance321 at gmail.com
Tue Jan 1 21:14:09 UTC 2019
auto foo(S s)
static foreach(k, p; [s, this])
for(int i = 0; i < p.length; i++)
The idea is to provide single for loop structure for each of the
variables(in this case s and this).
The is to avoid string mixins which are pathetic for this kind of
The point is that instead of having to do
for(int i = 0; i < s.length; i++)
for(int i = 0; i < this.length; i++)
in which case ... might be very long.
Sure one can create a function and all that mess but the compiler
should be able to do symbol replacement very naturally and easily.
More information about the Digitalmars-d-learn