Re: [sigc] Interesting minor libsigc++ 2 problems



Am 2004.02.14 18:11 schrieb(en) Murray Cumming:
These are not big problems, but they are interesting when porting to
libsigc++ 2:

1. In libsigc++ 1.2 you can do button.signal_clicked().connect (*this,
&Gtk::Widget::hide)
but in libsigc++ 2 you need to write a separate intermediate method to
handle the signal and then call hide().

Hm, I'm afraid you have to do button.signal_clicked().connect(
 *(Gtk::Widget*)this, &Gtk::Widget::hide);

I have no idea why Karl originally added this restriction to
libsigc++ 2. It seems stupid. Shall we try to lift it again?
(I think I had a look at boost at some time and they have
this restriction but I don't have any problems with this...)

2. In libsigc++ 1.2 you can override a method like so:
  void do_something(const Slot0<void>& slot);
  void do_something(const Slot1<void, int>& slot);
but in libsigc++ 2 that is ambiguous when you try to call
do_something().

We could get around this, too, by reintroducing slot# templates
besides slot (like signal# and signal). It seems that this
would also be worth it, given that you already ran into troubles ...

Sorry for not giving actual compiler errors - I'm rushed.

No problem :)

Regards,

 Martin



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