Range golf challenge: apply predicate to a subrange, returning the original range modified.

FeepingCreature feepingcreature at gmail.com
Fri Oct 7 15:20:50 UTC 2022


On Friday, 7 October 2022 at 15:18:08 UTC, FeepingCreature wrote:
> `range.select` returns a subrange of `range`. What's desired is 
> "`range`, but with the *subrange only* mapped to `modify`."

For example!

```
auto result = 10.iota.selectSubrange!isEven.mapSubrange!"a * 2";

assert(result.equal([0, 1, 4, 3, 8, 5, 12, 7, 16, 9]));
```


More information about the Digitalmars-d mailing list