[1] shameless plug: https://github.com/duneroadrunner/SaferCPlusPlus#reference-c...
[2] https://github.com/duneroadrunner/SaferCPlusPlus#asynchronou...
Exaggerated, I know, but it's not like your post was particularly nuanced.
Reference counting is safe with a DAG (not just a tree), but I get your point. For the times I've needed an arbitrary graph data structure, I used an adjacency matrix to store it.