|
Boost Users : |
From: Fabio Fracassi (f.fracassi_at_[hidden])
Date: 2008-08-18 08:16:48
Hi,
I'm currently trying to wrap (or forward) a call to
boost::signal<A_func_Signature>::connect(), to - amongst other things -
insulate users from using boost::bind.
So what I have is something like this:
template< typename Signature, class Reciever >
void connect( const signal_id& id,
const Signature& sig,
const Reciever* rcv
)
{
typedef ???? AdaptedSignature;
get_signal< AdaptedSignature > ( id ) -> connect(boost::bind(sig, rcv,
_1));
}
now this code is supposed to be called like this:
connect( some_signal_id, &SomeClass::some_member, someClass_instance );
where SomeClass::some_member has the same function signature as the
signal which is associated with some_signal_id.
e.g.
boost::signal<void (bool)> signal;
struct SomeClass {
void some_member(bool b);
};
So my question is how can I construct the "AdaptedSignature" type from
the template deduced "Signature"?
From what I gather from the documentation, boost function_types might
hold the answer to my question, but I cannot figure out how.
So is what I am trying to do possible, and is function_types the right tool?
TIA
Fabio
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net