
Emil Dotchevski
On Fri, Mar 30, 2012 at 12:26 PM, Christopher Pisz
What are one's options when the code one is working on contains a circular dependency and one is trying to update it to use a shared_ptr vs a raw
austin.rr.com> wrote: pointer?
You could use weak_ptr to break shared_ptr cycles.
Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode
From boost docs: Q. Can an object create a weak_ptr to itself in its constructor?
A. No. A weak_ptr can only be created from a shared_ptr, and at object construction time no shared_ptr to the object exists yet. This is the problem I cannot seem to easily overcome in both the case of the shared and weak ptr. It seems to work with a raw this pointer, but then I cannot achieve my goal.