map! filter! and range algorithm

Timon Gehr timon.gehr at gmx.ch
Mon Mar 4 12:21:30 PST 2013


On 03/04/2013 09:06 PM, Andrea Fontana wrote:
> If I understand it correctly something like:
>
> range.filter!(...).map!(...)
>
> browse range 2 times, one for filter and one for mapping doesn't it?
>

It does not.

> Is there a way to "parallelize" this kind of operations?
>

Interleaving is the default. To perform two traversals you'd have to 
force evaluation using eg. range.filter!(...).array.map!(...).


More information about the Digitalmars-d-learn mailing list