Douglas Gregor wrote:
This operation is not possible with Signals: you can't get at the individual slots once they're connected. Essentially, Signals was designed with the idea that comparing function objects for equality when connecting/disconnecting is a bad idea, because it breaks down when the function objects you build are non-trivial (because it becomes hard to duplicate the function object when calling disconnect()).
Doug
Well, I managed to get the functionality that I want but it feels kind of stupid-I probably shouldn't be using signals to solve this problem. vector<Callback> callbacks; boost::signals::connection myConnection; void Signal::Connect(Callback f) { if(myConnection.connected()) { // walk callback vector and for each element if(element.functor.obj_ptr==f.functor.obj_ptr) return ; // don't want to connect again } myConnection=mySignal.connect(f) // store callback f in a vector } In my particular case Callback is a wrapper around class member function and I am only concerned about not connecting the same object twice. I create Callback in class method like: Callback f; f=boost::ref(*this); Signal::Connect(f); It really feels very kludgy, in particular because I wanted to connect different types, having identical member function signature. Doing it old-fashioned way I would have every connectable type derive from the same base class that has callback as the member function with desired signature. Unfortunately, that is exactly what I was trying to avoid and what prompted me to try use signals. I guess I am overengineering the solution with improper tool. Tony