Re: [gtkmm] retype() and retype_return()



Am 24.07.2002 21:13 schrieb(en) Murray Cumming:
Does anyone mind if I also remove retype() and retype_return(). Remember
that we will still have bind_return().

Yes: bind(_return) and retype(_return) are completely different! The
former helps you to connect a function to a signal that has more
parameters (a return type) than the signal:

void foo(int num) {}
Signal0<void> signal1;
signal0.connect(bind(slot(&foo),5));

The latter allows you to make simple conversions of the parameter types
(return type) in a very convinient way:

void foo(int num) {}
Signal1<void,float> signal1;
signal1.connect(retype<void,float>(slot(&foo)));

Both are quite common operations (at least I think so and I do use them
both). A feature like retype() has been asked for on the mailing list
more than once before libsigc++ 1.1 got spread.

Regards,

  Martin



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