Retyping

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 retype template. retype has template arguments just like Signal - return value, signal types.

It's a function template that takes a slot, and returns a slot. eg.

void dostuff(double foo)
{
}

SigC::Signal1<void,int> asignal;

asignal.connect(  retype<void,int>( slot(&dostuff) )  );

If you only want to change the return type, you can use retype_return. retype_return needs only one template argument.