| 9 | #include <taskflow/taskflow.hpp> |
| 10 | |
| 11 | int main() |
| 12 | { |
| 13 | tf::Taskflow taskflow; |
| 14 | |
| 15 | std::vector<int> items{ 1, 2, 3, 4, 5, 6, 7, 8 }; |
| 16 | |
| 17 | auto task = taskflow.for_each( |
| 18 | items.begin(), items.end(), [](int item) |
| 19 | { |
| 20 | std::cout << item; |
| 21 | } |
| 22 | ); |
| 23 | |
| 24 | taskflow.emplace([]() { std::cout << "\nS - Start\n"; }).name("S").precede(task); |
| 25 | taskflow.emplace([]() { std::cout << "\nT - End\n"; }).name("T").succeed(task); |
| 26 | |
| 27 | { |
| 28 | std::ofstream os("taskflow.dot"); |
| 29 | taskflow.dump(os); |
| 30 | } |
| 31 | |
| 32 | tf::Executor executor; |
| 33 | executor.run(taskflow).wait(); |
| 34 | |
| 35 | return 0; |
| 36 | } |
nothing calls this directly
no outgoing calls
no test coverage detected