Hello group,
Boost.Function is exhibiting differing behavior in different boost releases:
//--------------------------
struct F
{
void operator()() { }
};
F obj; // assume obj remains in scope for duration of sample
boost::function<void()> f1 = boost::ref( obj );
boost::function<void()> f2 = f1;
assert( f1 == boost::ref( obj ) );
assert( f2 == boost::ref( obj ) ); // Passes in 1.35.0, Fails in 1.39.0
boost::function<void()> f3 = boost::ref( obj );
boost::function<void()> f4;
f3.swap( f4 );
assert( f3 != boost::ref( obj ) );
assert( f4 == boost::ref( obj ) ); // Passes in 1.35.0, Fails in 1.39.0
//---------------------------
I'm assuming 1.35.0 is demonstrating the correct behavior whereas 1.39.0 is exhibiting a bug,
but I thought I'd defer to the group before I reported it. Am I correct?