22 ProgressCallback cb,
size_t reportProgressEvery = 1024 );
27template <
typename I,
typename F,
typename ...Cb>
30 if constexpr (
sizeof...( cb ) == 0 )
34 std::forward<F>( f )( I( i ) );
41 std::forward<F>( f )( I( i ) );
45 }, std::forward<Cb>( cb )... );
53template <
typename I,
typename L,
typename F,
typename ...Cb>
54inline auto ParallelFor( I
begin, I
end, tbb::enumerable_thread_specific<L> & e, F && f, Cb && ... cb )
58 std::forward<F>( f )( I( i ), *(L*)ctx );
62 }, std::forward<Cb>( cb )... );
68template <
typename T,
typename ...F>
71 return ParallelFor(
size_t(0), v.size(), std::forward<F>( f )... );
77template <
typename T,
typename I,
typename ...F>
86template <
typename T,
typename I,
typename ...F>
std::vector<V>-like container that is 1) resized without initialization of its elements,...
Definition MRBuffer.h:58
Definition MRFunctional.h:15
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:23
MRMESH_API void parallelFor(size_t begin, size_t end, FunctionRef< void(size_t)> f)
MR_BIND_IGNORE_PY auto end(const BitSet &)
Definition MRBitSet.h:397
MR_BIND_IGNORE_PY auto begin(const BitSet &a)
Definition MRBitSet.h:395
auto ParallelFor(I begin, I end, F &&f, Cb &&... cb)
Definition MRParallelFor.h:28
I beginId() const
returns the identifier of the first element
Definition MRBuffer.h:105
I beginId() const
returns the identifier of the first element
Definition MRVector.h:145
I endId() const
returns backId() + 1
Definition MRBuffer.h:111
I endId() const
returns backId() + 1
Definition MRVector.h:151
only for bindings generation
Definition MRCameraOrientationPlugin.h:8