How to walk over two arrays by ref in beautyfull way?

vitalfadeev vital.fadeev at gmail.com
Mon Jun 10 07:41:40 UTC 2019


How to?

I plan scan First array with checkers:
[checker, checker, checker]

...and store result to Second array:
[0, 0, 1]

In next code 'r' not reference. But expected ref.

     import std.range : zip;

     foreach(checker, ref r; zip(checkers, result.set)) {
        r = checker();
     }

What is the best way for speed and beautyfull D code?




More information about the Digitalmars-d-learn mailing list