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

2019-06-10 Thread vitalfadeev via Digitalmars-d-learn
Thanks! I happy! You are really powerfull!

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

2019-06-10 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2019-06-10 at 08:02 +, vitalfadeev via Digitalmars-d-learn wrote: […] Perhaps I am missing something that is critical to the example, but I rewrote the code as: import std.algorithm: map; import std.stdio: writeln; bool false_cb() { return false; } bool true_cb() {

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

2019-06-10 Thread Anonymouse via Digitalmars-d-learn
On Monday, 10 June 2019 at 08:02:18 UTC, vitalfadeev wrote: On Monday, 10 June 2019 at 07:45:42 UTC, vitalfadeev wrote: On Monday, 10 June 2019 at 07:41:40 UTC, vitalfadeev wrote: How to? I plan scan First array with checkers: [checker, checker, checker] ...and store result to Second array:

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

2019-06-10 Thread vitalfadeev via Digitalmars-d-learn
On Monday, 10 June 2019 at 07:45:42 UTC, vitalfadeev wrote: On Monday, 10 June 2019 at 07:41:40 UTC, vitalfadeev wrote: 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.

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

2019-06-10 Thread vitalfadeev via Digitalmars-d-learn
On Monday, 10 June 2019 at 07:41:40 UTC, vitalfadeev wrote: 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;

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

2019-06-10 Thread vitalfadeev via Digitalmars-d-learn
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