30 Apr
2003
30 Apr
'03
5:54 p.m.
Christopher Currie wrote:
"shared_ptr_basic_test.cpp" // ... // prior to this line, p5 is a shared_ptr<void> with // use_count == 1, weak_count == 1.
line 226: weak_ptr<X> wp2 = static_pointer_cast<X>(p5);
// static_pointer_cast creates a shared_ptr<X> temporary: // use_count == 2, weak_count == 2. // temporary is passed to weak_ptr<X>'s constructor // use_count == 2, weak_count == 3. // temporary is NOT immediately destructed.
line 228: BOOST_TEST(wp3.use_count() == 1); // this test failed
// Sometime after this point (possibly as late as the end of the // function scope) the temporary is destructed.
Oops, line 228 should be: BOOST_TEST(wp2.use_count() == 1); // this test failed Christopher