Re: [sigc] How does std::function<> work with libsigc++
- From: Murray Cumming <murrayc murrayc com>
- To: Chris Vine <chris cvine freeserve co uk>
- Cc: libsigc-list gnome org
- Subject: Re: [sigc] How does std::function<> work with libsigc++
- Date: Fri, 09 Aug 2013 13:09:29 +0200
On Mon, 2013-07-29 at 20:54 +0100, Chris Vine wrote:
On Mon, 29 Jul 2013 20:44:02 +0200
Kjell Ahlstedt <kjell ahlstedt bredband net> wrote:
Wouldn't it be cleaner to just (or also) add a specific
connect(std::function<>) method overload that did this
automatically?
Sure. I wish I knew how to do it. sigc::track_obj() forces you to
manually specify which trackable objects the functor contains. This
is not nearly as nice as the automatic detection of trackable objects
in the rest of libsigc++. The enormous use of C++ templates in
libsigc++ is near, or even beyond, the limits of my comprehension.
I have to say I disagree with that. One of the banes of libsigc++ is
that it makes any slot for a non-static method of a class deriving
from sigc::trackable as a tracked slot, which is sometimes what you do
not want. It is better to enable the user to choose when constructing
the slot.
[snip]
Can you give us an example of when you would not want the slot to be
tracked?
--
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]