10 template<
typename Impl,
typename... Types>
13 template<
typename Impl,
typename Type,
typename... Rest>
18 template<
typename F,
typename... Args>
19 typename std::result_of<F(Type&, Args...)>::type
call(
const F& func, Args&& ... args) {
20 if (m_value ==
nullptr) {
22 m_value =
new Type(std::move(this->m_func()));
24 return this->m_rest.call(func, *m_value, std::forward<Args>(args)...);
35 Type* m_value =
nullptr;
38 template<
typename Impl>
45 template<
typename Impl,
typename... Types>
54 template<
typename IndexF,
typename IndexL,
typename IndexS,
typename Func,
typename RM>
55 void parallelFor(IndexF first, IndexL last, IndexS step,
const Func& f, RM& rm) {
56 for (IndexF i = first; i < last; i += step) {
std::result_of< F(Type &, Args...)>::type call(const F &func, Args &&...args)
int getNumThreads() const
void parallelFor(IndexF first, IndexL last, IndexS step, const Func &f, RM &rm)