I'm wondering, if it is possible to get reference to slot object within combiner. Something like this:


struct Slot
{
     Slot& operator()()
     {

         return *this;
     }

};

 

struct Combiner
{
      typedef const Slot& result_type;

      template<typename InputIterator>

      const Slot& operator()(InputIterator first, InputIterator last)

      {
            const Slot& slot = (*first);
            return slot;
      }

};

 


int main()

{

boost::signal< Slot (), Combiner > sig;

Slot slot1;
Slot slot2;

 

sig.connect(slot1);
sig.connect(slot2);


const Slot& slot = sig(); // reference to slot1?
...

}
 

I'm not sure if last reference to slot can be safely used.
What is the other ways how can I get reference to slot?

Thanks in advance