Boost logo

Boost :

From: Fabio Fracassi (f.fracassi_at_[hidden])
Date: 2008-08-25 08:00:51


I'm sorry, this is a repost of a message I send to boost user, with a
somewhat more restrictive subject. I didn't get any input there, and I
hope that someone can help me here.

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.


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?



Boost list run by bdawes at, gregod at, cpdaniel at, john at