Boost logo

Boost :

From: Thomas Witt (witt_at_[hidden])
Date: 2002-05-15 07:10:55


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

Peter,

On Wednesday 15 May 2002 13:34, Peter Dimov wrote:
> Something along these lines was my initial argument against providing
> weak -> shared conversions when Darin suggested it. But: these conversions
> are the only way to make a weak_ptr safe, especially in a multithreaded
> environment; and they don't actually _break_ the design.

Agreed.

Just to make this clear Iwasn't saying they brake the smart_ptr design, but my
design using samrt ptrs. But given your explanation I have to admit that my
design was flawed anyway.

>
> The intended use pattern is for clients to take ownership only temporary,
> as if holding a lock on the object; clearly, the object shouldn't go away
> in the middle of a "transaction."

Agreed.

>
> Even if clients abuse the conversion, and take permanent ownership, this
> doesn't break the "object server." It still operates as usual. Presumably
> the client has good reasons to keep that particular object alive.

In my case I believe to have good reason not to allow the clients to keep the
object alive. So it boils down to the question whether taking a non temporary
shared_ptr is abuse or mistake.

Thanks for the explanation

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

iD8DBQE84lBT0ds/gS3XsBoRAmFPAKCAZ8ijGTm9VEJfvVupy4BlqkHlLACeKbON
LyoA/jKnyWMlbHDiVUhDQtQ=
=Jyt6
-----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