Skip to content

Commit af097d7

Browse files
committed
perfect forwarding in simdFor
1 parent 5cfd227 commit af097d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

inst/include/RcppParallel/simd/algorithm.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ F simdFor(const T* it, const T* end, F&& f)
3030
const T* aligned_end = aligned_begin + (end - aligned_begin) / N * N;
3131

3232
for (; it != aligned_begin; ++it)
33-
f(*it);
33+
std::forward<F>(f)(*it);
3434

3535
for (; it != aligned_end; it += N)
36-
f(boost::simd::aligned_load<vT>(it));
36+
std::forward<F>(f)(boost::simd::aligned_load<vT>(it));
3737

3838
for (; it != end; ++it)
39-
f(*it);
39+
std::forward<F>(f)(*it);
4040

4141
return f;
4242
}

0 commit comments

Comments
 (0)