I have a directed acyclic graph implemented by Graph and Node classes. Each node has a list of pointers to children and a list of pointers to parents. [...] The Child list uses
std::shared_ptrso that nodes are kept in memory at least as long as they have parents. But I don't want a node to own its parents, so I used
weak_ptrfor the pointers to parents.
But then there was a problem with the algorithms...