On 2018-06-30 22:53:47 +0000, Jerry said:
Btw this is pretty much std.algorithm.each
import std.algorithm;
void main() {
auto cs = [ new C(), new C() ];
cs.each!(o => o.A());
}
https://dlang.org/phobos/std_algorithm_iteration.html#.each
The looping needs to be done in the handler because there are two loops
running one after the other and the range to loop over is detected in
the handler too. Otherwise a lot of code duplication would happen.
--
Robert M. Münch
http://www.saphirion.com
smarter | better | faster