Boost logo

Boost :

From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2007-03-23 17:05:56


On Friday 23 March 2007 16:57 pm, David Abrahams wrote:
> on Fri Mar 23 2007, "Zach Laine" <whatwasthataddress-AT-gmail.com> wrote:
> > + // Test auto-disconnection, part 2
> > + int value = 0;
> > + BOOST_CHECK(value == 0);
> > + {
> > + short_lived_2 *shorty_2 = new short_lived_2;
> > + boost::signal0<int> s2;
> > + s2.connect(boost::bind(&short_lived_2::f, shorty_2));
> > + delete shorty_2;
> > + value = s2();
> > + }
> > + BOOST_CHECK(value == 0);
> > +

It looks to me like this test has undefined behaviour? That is, it is
calling last_value with a non-void return value with no slots connected
(assuming tracking is working).

-- 
Frank



Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk