Boost logo

Boost :

From: Daniel Frey (d.frey_at_[hidden])
Date: 2008-04-26 13:44:19


On Sat, 2008-04-26 at 13:20 -0400, Frank Mori Hess wrote:
> On Saturday 26 April 2008 12:34, Daniel Frey wrote:
> > OK, understood. The attached version should behave as expected and
> > passes all regression tests. It requires weak_count.empty().
>
> One minor tweak, init_weak_once doesn't seem to need two if statements:
>
> void init_weak_once() const
> {
> if( _weak_count.empty() )
> {
> detail::shared_count( (void*)0, detail::sp_deleter_wrapper() ).swap( _shared_count );
> _weak_count = _shared_count;
> }
> }

Yepp. I already noticed it as well. :)

I think all in all the new version is a good improvement over the former
one. It passes the new regression test, it is more efficient and FWIW I
find its implementation details much easier to understand than the trunk
version. OK to commit?

Regards, Daniel


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