29template <
typename I,
typename F,
typename ...Cb>
32 if constexpr (
sizeof...( cb ) == 0 )
36 std::forward<F>( f )( I( i ) );
43 std::forward<F>( f )( I( i ) );
47 }, std::forward<Cb>( cb )... );
53template <
typename I,
typename F>
58 std::forward<F>( f )( I( i ) );
66template <
typename I,
typename L,
typename F,
typename ...Cb>
67inline auto ParallelFor( I
begin, I
end, tbb::enumerable_thread_specific<L> & e, F && f, Cb && ... cb )
71 std::forward<F>( f )( I( i ), *(L*)ctx );
75 }, std::forward<Cb>( cb )... );
81template <
typename T,
typename ...F>
84 return ParallelFor(
size_t(0), v.size(), std::forward<F>( f )... );
90template <
typename T,
typename I,
typename ...F>
99template <
typename T,
typename I,
typename ...F>
#define MRMESH_API
Definition MRMeshFwd.h:85
std::vector<V>-like container that is 1) resized without initialization of its elements,...
Definition MRBuffer.h:60
Definition MRFunctional.h:15
Vector<T> is indexed by size_t.
Definition MRVector.h:24
void parallelFor(size_t begin, size_t end, FunctionRef< void(size_t)> f)
auto ParallelFor(I begin, I end, F &&f, Cb &&... cb)
Definition MRParallelFor.h:30
std::function< bool(float)> ProgressCallback
Definition MRMeshFwd.h:790
I beginId() const
returns the identifier of the first element
Definition MRBuffer.h:112
I beginId() const
returns the identifier of the first element
Definition MRVector.h:181
I endId() const
returns backId() + 1
Definition MRBuffer.h:118
I endId() const
returns backId() + 1
Definition MRVector.h:187
auto begin(ViewportMask mask)
Definition MRViewportId.h:122
auto end(ViewportMask)
Definition MRViewportId.h:124
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8