Boost logo

Boost Users :

Subject: Re: [Boost-users] [signals2][review] The review of the signals2 library (formerly thread_safe_signals) begins today, Nov 1st
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2009-02-19 09:48:21


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

On Wednesday 18 February 2009, Nat Goodspeed wrote:
> Frank Mori Hess wrote:
> > But if you mean the general feature
> > of searching for some base class during connect and automatically
> > tracking those objects, that might get added in the future. I would do
> > it strictly as an optional extension though, in separate headers and only
> > using the library's existing public interfaces. It would add a free
> > function findable by ADL that would look for the trackable base class
> > when connecting, something like:
> >
> > class shared_trackable: public enable_shared_from_this<shared_trackable>
> > {};
>
> If I understand correctly, we expect the coder to pass to boost::bind()
> a plain pointer, a reference or a weak_ptr to a shared_trackable
> subclass instance. None of those will artificially prolong the life of
> that instance. However, using enable_shared_from_this lets your visitor
> obtain a shared_ptr to pass to slot_type::track(). Yes?

Yes

>
> It's still the case that if the coder passes to boost::bind() an actual
> shared_ptr to the shared_trackable subclass instance, the
> slot_type::track() mechanism becomes irrelevant because the object won't
> die. That might warrant a note in the documentation for this feature.

Yes, that's why I suggested you could have the visitor give a compile error on
finding a shared_ptr<shared_trackable> in the bind functor.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkmdcTUACgkQ5vihyNWuA4WD6wCgn9OC6qi4QLLfGPa2xSArHzTf
NmsAniN+eywOOJvKvyumqj7b3z1Wj2VJ
=G27o
-----END PGP SIGNATURE-----


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net