13 May 09:19
Booost.Signals reference to slot within combiner
From: Yan Drugalya <ydrugalya <at> gmail.com>
Subject: Booost.Signals reference to slot within combiner
Newsgroups: gmane.comp.lib.boost.user
Date: 2008-05-13 07:20:01 GMT
Subject: Booost.Signals reference to slot within combiner
Newsgroups: gmane.comp.lib.boost.user
Date: 2008-05-13 07:20:01 GMT
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 mailing list Boost-users <at> lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
RSS Feed