$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-07-11 15:21:28
From: "Mark Storer" <mstorer_at_[hidden]>
> So the only purpose of a weak_ptr is to be able to grab a shared_ptr from
it
> (and to avoid circular references, of course)?
Yes. The "idiomatic" use is:
weak_ptr<X> wp;
// ...
if(shared_ptr<X> p = make_shared(wp))
{
// use p
}
else
{
// target lost
}