Boost logo

Boost :

Subject: Re: [boost] [smart_ptr] shared_ptr template type
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2009-07-09 13:58:52


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 09 July 2009, Sid Sacek wrote:
> > I wonder if it might be better/possible to have a shared_ptr<T> that
>
> didn't
>
> > assume its corresponding "raw" pointer type was T* but rather T.
>
> If I'm not mistaken, the C++0x committee is setting the 'shared_ptr<>'
> class in stone as we speak. I seriously doubt that can be changed this
> late in the game, considering the amount of code that is already using
> this class as-is.

I'm not under any delusions about getting such a change to std::shared_ptr
into c++0x. That doesn't preclude something like this being added to boost
though, under a different name (I'll call it "generalized_shared" for the
moment). Then boost::shared_ptr could be implemented as

template<typename T>
class shared_ptr: public generalized_shared<T*>
{...};

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkpWL90ACgkQ5vihyNWuA4Uk2ACcDr+WxE2Ku00ljjQRnUB+1n/c
m4EAnjYLI/S+5KyIgopMyLFrI9xX10vB
=cOH8
-----END PGP SIGNATURE-----


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