Boost logo

Boost :

From: Thomas Witt (witt_at_[hidden])
Date: 2002-05-15 04:41:40


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

On Tuesday 14 May 2002 20:02, Peter Dimov wrote:
> This will no longer be necessary with 1.28.0; we've removed operator* and
> operator-> from weak_ptr as unsafe. Now the only way to do something with a
> weak_ptr is to construct a shared_ptr first, via its constructor or
> make_shared.

Peter,

can you explain why make_shared adds safety. Currently I am unable to see why.
IIUC what happens is a NULL ptr is dereferenced with or without make_shared.
On the first look it seems as if make_shared pretends to be safe but isn't.
When make shared is used the object might be gone already.

Thanks

Thomas

- --
Dipl.-Ing. Thomas Witt
Institut fuer Verkehrswesen, Eisenbahnbau und -betrieb, Universitaet Hannover
voice: +49(0) 511 762 - 4273, fax: +49(0) 511 762-3001
http://www.ive.uni-hannover.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD4DBQE84i1Y0ds/gS3XsBoRAlhFAJjpwYXAmZ8C2ZRuRP7gFMeBvDwOAJ9AekFk
W2by4M7s67FMskfAm9/iyQ==
=qr/f
-----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