A similar topic is retyping. Perhaps you have a signal that takes an int
, but
you want to connect a function that takes a double
.
This can be achieved with the sigc::retype
template. retype
has template arguments
just like sigc::signal
- return value, signal types.
It's a function template that takes a sigc::slot
, and returns a sigc::slot
. eg.
void dostuff(double foo) { } sigc::signal<void,int> asignal; asignal.connect( sigc::retype<void, int>( slot(&dostuff) ) );
If you only want to change the return type, you can use sigc::retype_return
.
retype_return
needs only one template argument.