AdamNiederer / faster

SIMD for humans
Mozilla Public License 2.0
1.56k stars 51 forks source link

Change `simd_map(Fn)` to `simd_map(FnMut)`? #9

Closed ralfbiedert closed 6 years ago

ralfbiedert commented 6 years ago

When trying to work with the 0.3 PackedIterator I noticed simd_map and simd_reduce take a Fn.

Would it make sense to relax this requirement to FnMut, so that the closures could modify their environment?

Rust's std::iter::Iterator seems to mostly use FnMut, and for my current use case (iterating a 2nd simd_iter while iterating another one) I would like to cause "side effects".

I assume my actual problem will be addressed in 0.4, but I could imagine people might have other reasons they could need this.

AdamNiederer commented 6 years ago

Resolved by #10.