bool detach(Node *a, Node *b, Link *l)

This function simplifies the unlinking of two nodes and a link. Its definition is:

bool detach(Node *a, Node *b, Link *l) {
  bool ret=true;
  if (a) ret&=a->unlink_to(l);
  if (b) ret&=b->unlink_from(l);
  l->link_to(0);l->link_from(0);
  return ret;
}
so it can be used also without checking the validity of the node pointers. Note: the order of the operations is important. Neuron assumes that the link passed to its methods has a valid node at the other end.