Skip to content

Commit e3cedfc

Browse files
updated taskflow.hpp
1 parent d3bd91f commit e3cedfc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

example/parallel_for.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ void taskflow(int N) {
2929
for(int n=0; n<N; ++n) {
3030
range[n] = n;
3131
}
32-
tf.parallel_for(range.begin(), range.end(), [&range] (int& i) {
32+
tf.parallel_for(range.begin(), range.end(), [&] (int& i) {
3333
printf("fib[%d]=%d\n", i, fib(i));
3434
});
3535
tf.wait_for_all();
36+
3637
auto tend = std::chrono::steady_clock::now();
3738
std::cout << "taskflow version takes "
3839
<< std::chrono::duration_cast<std::chrono::milliseconds>(tend-tbeg).count()

taskflow.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ template <typename F>
488488
BasicTaskflow<F>::Task::Task(const Task& rhs) : _node {rhs._node} {
489489
}
490490

491+
// Function: precede
491492
template <typename F>
492493
typename BasicTaskflow<F>::Task& BasicTaskflow<F>::Task::precede(Task tgt) {
493494
_node->precede(*(tgt._node));

0 commit comments

Comments
 (0)