Boost logo

Boost Users :

From: Yan Drugalya (ydrugalya_at_[hidden])
Date: 2008-05-13 03:20:01


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



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