Re: [sigc] Functor not resolving between overloaded methods with different slot types



On 7 February 2016 at 14:48, Kjell Ahlstedt <kjell ahlstedt bredband net> wrote:
This problem was reported long ago in bug
https://bugzilla.gnome.org/show_bug.cgi?id=306705.
I've tried to find a solution, but I didn't quite succeed. You'll have to do
with a workaround. Paul suggested one workaround, although I wonder if it's
really a workaround for your problem. It looks like a way to select the
correct Activity::callback() when there are several overloaded ones.  I
mentioned another workaround in comment 4 in that bug report. In your case
it would be
  foo(sigc::slot<void, Glib::ustring*>(sigc::mem_fun(*this,
&Activity::callback)));
which is almost identical to what you've used yourself.

Kjell


Thank you Kjell,

I'm now using your cast solution.  Adding a typedef and using a C++
static_cast my test case looks like:

  typedef sigc::slot<void, Glib::ustring *> ActivitySlot;
  foo(static_cast<ActivitySlot>(sigc::mem_fun(*this, &Activity::callback)));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]