Closed maribu closed 8 years ago
This is indeed a bug. Diffract slices the input range and performs the algorithm on each sub-range. The problem here is that the first range doesn't contain any element satisfying the predicate so returns std::end of the sub-range, which is the first element of the second slice. The reduction operator then takes the iterator with a minimal distance from the start, which is the first element of the second slice.
This requires a change in diffract, I don't have time to fix this right now but i will do it at some point this week. If you want to fix this yourself and submit a PR you are welcome to do so,
Hi!
I get a wrong result from the parallel
find_if
version in a simple code example. I tried to reproduce the problem in the gtest unit test attest/alg.nonmodifying/alg.gen.find/find.cpp:47
, but without success. Maybe it's just me being stupid, but I really cannot figure out whats wrong here.examples/find_if.cpp
compiled with
gives output
compiled with
gives output