Boost logo

Boost Users :

From: Doug Gregor (dgregor_at_[hidden])
Date: 2004-08-02 09:05:30


On Aug 2, 2004, at 12:48 AM, Oliver Kowalke wrote:

> Am Montag, 2. August 2004 01:25 schrieb Doug Gregor:
>
>>> - I call sig(); and the first slot connects a new slot to signal
>>> which
>>> has a
>>> higher priority (group -> higher values are executed at first)
>>
>> According to the docs,
>
> docs : http://www.boost.org/doc/html/signals.html ?

Yes.

>> it's unspecified whether or not this slot will
>> be called.
>
> Because I need only the topmost slot called, I could add a combiner
> which
> dereferences only one time and loop over signal - could result in side
> effects?!
>
> struct call_topmost
> {
> typedef void result_type;
>
> template<typename InputIterator>
> result_type operator()(InputIterator first, InputIterator last)
> const
> {
> if ( first != last) * first;
> }
> };

Yes, this will invoke only the first slot, which is of course free to
remove itself or connect other slots.

        Doug


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