Boost logo

Boost :

From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2008-04-29 09:51:43


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

On Tuesday 29 April 2008 09:26 am, Daniel Frey wrote:
> On Tue, 2008-04-29 at 09:02 -0400, Frank Mori Hess wrote:
> > I've noticed it is possible to construct a half-empty shared_ptr that has
> > an empty shared_count but a non-null pointer (brief example program
> > attached). Perhaps the aliasing constructor, and similarly the
> > shared_count constructor should do some argument checking?
>
> I think this is already a known problem/feature, see n2588
> <http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2588.pdf>,
> 20.6.12.2.1/18. I don't know what it's good for, though.

There's a note saying it is possible to create an empty shared_ptr with a
non-null stored pointer, but it also states that get() is required to return
null for an empty shared_ptr, and operator* and operator-> require get() !=
0.

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

iD8DBQFIFyfw5vihyNWuA4URAjIdAKCQadk/Q9RpxiDQtUHPx2QG3jSSAACePHPQ
+8PvDZr8ZoLi3vSdMjeEI5U=
=TsAu
-----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