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

This function simplify the linking of two nodes with a link. Its definition is:

bool attach(Node *a,Node *b, Link *l) {
  bool ret=true;
  if (a) ret&=a->link_to(l);
  if (b) ret&=b->link_from(l);
  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.