« Return to Thread: [smart_ptr] shared_ptr template type

Re: [smart_ptr] shared_ptr template type

by Frank Mori Hess :: Rate this Message:

Reply to Author | View in Thread

-----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-----
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

 « Return to Thread: [smart_ptr] shared_ptr template type