Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b87c6b commit 6549710Copy full SHA for 6549710
taskflow/graph/graph.hpp
@@ -75,22 +75,20 @@ inline Node::Node(C&& c) : _work {std::forward<C>(c)} {
75
// Destructor
76
inline Node::~Node() {
77
if(_subgraph.has_value()) {
78
- std::vector<std::forward_list<Node>> gs;
79
- gs.emplace_back();
80
- std::swap(gs[0], _subgraph.value());
+ std::list<Graph> gs;
+ gs.push_back(std::move(*_subgraph));
81
_subgraph.reset();
82
size_t i=0;
83
while(i<gs.size()) {
84
auto n = gs[i].begin();
85
while(n != gs[i].end()) {
86
if(n->_subgraph.has_value()) {
87
88
- std::swap(gs.back(), n->_subgraph.value());
+ gs.push_back(*(n->_subgraph));
89
n->_subgraph.reset();
90
}
91
- n ++;
+ n++;
92
93
- i ++;
+ i++;
94
95
96
0 commit comments