Category : garbage-collection

Suppose we have a design where objects have a possibly reciprocating dependency on other objects: struct Object { … virtual void method(); private: std::vector<std::shared_ptr<Object>> siblings; }; There is danger of circular dependencies. This could be broken by use of weak pointers, but then the design immediately becomes fragile as it introduces the very likely possibility ..

Read more