Skip to content

Commit

Permalink
Introducing local variables for lambda capture in split_at
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasgd committed Sep 15, 2022
1 parent 50c365e commit c235844
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arbor/morph/segment_tree.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <iostream>
#include <stdexcept>
#include <set>
#include <map>
#include <vector>

Expand Down Expand Up @@ -93,7 +92,9 @@ std::pair<segment_tree, segment_tree>
split_at(const segment_tree& tree, msize_t at) {
if (at >= tree.size() || at == mnpos) throw invalid_segment_parent(at, tree.size());
// span the sub-tree starting at the splitting node
auto [post, copied] = copy_subtree_if(tree, {mnpos, at}, yes);
const auto& post_copied = copy_subtree_if(tree, {mnpos, at}, yes);
auto post = post_copied.first;
auto copied = post_copied.second;

// copy the original segment_tree (as a graph), skipping all nodes in the `post` subtree
segment_tree pre = copy_fulltree_if(tree,
Expand Down

0 comments on commit c235844

Please sign in to comment.