Are there any static analysis tools that can help detect shared_ptr<> circular references?
Even if such a tool couldn't detect complicated cases, it would still be useful for eliminating the simple cases.
Don't know about existing of such tools, but here are nice thoughts about the problem:
The key to effective object life time management is to have an acyclic object ownership graph. Then you use shared pointers when going down, weak pointers when going sideways, and weak pointers (or sometimes plain pointers) when going up the graph.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With