Boost logo

Boost Users :

From: Frank Mori Hess (fmhess_at_[hidden])
Date: 2008-05-18 00:32:34


On Sunday 18 May 2008 00:10, Jose Martinez wrote:
> In the shared_from_this() function of the enable_shared_from_this base
> class, the weak pointer _internal_weak_this is never initialized. Why
> is that so? The use_count of the _internal_weak_ptr is at least 1 as
> long as there is a shared_ptr already pointing to *this. How does the
> un-initialized weak_ptr know that there is a shared_ptr already created
> and how can it access the number of references? I'm sure there is a
> simple explanation that I am not catching in my readings.

It gets initialized by the shared_ptr constructor.

-- 
Frank



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net