tl::optional<typename ForeverStack<N>::Node &> child = tl::nullopt;
+ /*
+ * On every iteration this loop either
+ *
+ * 1. terminates
+ * 2. decreases the depth of the node pointed to by current_node
+ *
+ * This ensures termination
+ */
while (true)
{
+ // may set the value of child
for (auto &kv : current_node->children)
{
auto &link = kv.first;
current_node = ¤t_node->parent.value ();
}
+ // if child didn't contain a value
+ // the while loop above should have return'd or kept looping
current_node = &child.value ();
insert_segment_resolution (outer_seg, current_node->id);
}