Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-08-26 11:50:59


From: "Robert Ramey" <ramey_at_[hidden]>
> It turns out this [shared_ptr] is not really well suited to my purposes.
I'm really interested in knowing something seemingly simpler wasn't used -
such as
>
> template<class T>
> class shared_count
> {
> };
>
> template<class T>
> class shared_ptr
> {
> shared_count<T> pn;
> T *px;
> };

shared_ptr<> can be instantiated with an incomplete type, and such
shared_ptr instances can be copied freely. Only the constructor requires a
complete type (remembered by shared_count.)


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