Skip to content

Commit ba930e5

Browse files
updated subflow.cpp
1 parent 12fd56e commit ba930e5

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

example/subflow.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,11 @@ int main(int argc, char* argv[]) {
3636
// Create a taskflow graph with three regular tasks and one subflow task.
3737
tf::Taskflow tf(std::thread::hardware_concurrency());
3838

39-
int value {0};
40-
auto [A, fuA] = tf.emplace([&] (tf::SubflowBuilder& subflow) {
41-
subflow.silent_emplace([&]() { value = 10; }).name("A1");
42-
subflow.detach();
43-
});
44-
auto B = tf.silent_emplace([&] () { /*assert(value == 10);*/ });
45-
A.precede(B);
46-
A.name("A");
47-
B.name("B");
48-
49-
/*auto [A, B, C, D] = tf.silent_emplace(
39+
auto [A, B, C, D] = tf.silent_emplace(
5040
// Task A
5141
[] () { std::cout << "TaskA\n"; },
5242
// Task B
5343
[cap=std::vector<int>{1,2,3,4,5,6,7,8}, detached] (auto& subflow) {
54-
5544
std::cout << "TaskB is spawning B1, B2, and B3 ...\n";
5645

5746
auto B1 = subflow.silent_emplace([&]() {
@@ -90,9 +79,6 @@ B.name("B");
9079
A.precede(C); // C runs after A
9180
B.precede(D); // D runs after B
9281
C.precede(D); // D runs after C
93-
*/
94-
// examine the graph
95-
std::cout << tf.dump() << '\n';
9682

9783
tf.dispatch().get(); // block until finished
9884

0 commit comments

Comments
 (0)