Boost logo

Boost :

From: Ville Varis (ville.varis_at_[hidden])
Date: 2004-06-03 07:35:26


The next piece of code fails with assertion when calling signals without any connections attached to it.

#include <boost/signal.hpp>

void test_signaling() {
    ::boost::signal0<int> sig;
/* Next call asserts in boost/last_value.hpp line 29 assert(first != last);

This is due to usage of default Combiner boost::last_value<R>. The problem occures when using non-void return values in signals.

I use boost version 1.30.0 but I didn't noticed any changes for this in version 1.31.0.

Quick workaround is to use other Combiner as default, where this problem is removed.

for example
    ... last_value ....
    T operator()(InputIterator first, InputIterator last) const
      if (first == last)
          return T();

best regards,

 Ville Varis

Boost list run by bdawes at, gregod at, cpdaniel at, john at