Warp wrote:
> Invisible <voi### [at] devnull> wrote:
>> Now what happens if you want to only process elements having some
>> arbitrary property? (E.g., only the odd numbers.)
>
> I make the function take a functor which tells which elements to
> process.
> This is a standard technique in C++.
You can even write a custom iterator that, when incremented, skips even
numbers. Then you can use it with the existing fold function.
Post a reply to this message
|