Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-01-15 06:26:01


From: "Nicola Musatti" <nmusatti_at_[hidden]>
> David Abrahams wrote:
> > "Peter Dimov" <pdimov_at_[hidden]> writes:
> [...]
> >>Of course you could do that as well, but my point is that the primary
> >>purpose of make_* functions is argument deduction, and the primary
purpose
> >>of make_shared/get_shared_ptr is to support the idiom above, where
argument
> >>deduction isn't important.
> >
> >
> > So what about as_shared or to_shared?
>
> Why not just 'share' ?

Because it doesn't share... that is partly why I don't like make_shared,
too. It doesn't make the object shared. It only retrieves a pointer to an
object that is already "shared".

An alternative is to use a member function. In

http://www.usenix.org/publications/library/proceedings/c++94/full_papers/ell
is.a

Ellis and Detlefs use wp.Pointer() for the weak to strong operation.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk