
26 Apr
2008
26 Apr
'08
3:34 p.m.
Daniel Frey:
When looking at the test case that fails with .use_count() != 0, I don't really see why the call to shared_from_this() in line 130 should throw.
The test looks correct to me. After early_px.reset() and px.reset(), no shared_ptr owns &x. Their initial use_count() is 2, so after the two resets a weak_ptr to &x should expire (it might be a good idea to add it to the test). We'll indeed need weak_count::empty to make this and test5 both pass, though.