Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2004-04-27 11:04:01


> > The main problem I had was that certain member variable weren't
> > accessible. The STL collections don't have that issue so there was no
> > problem.

> Sorry if this is silly question, but why would you need an access to the
> counter? IMO we should be able to save/load shared_ptr without need to
> save it.

I checked the code (which was written some time ago) and the answer to that
question isn't obvious to me. I do remember starting with the idea that it
wouldn't be necessary to look beyond shared_ptr but I had to just keep
adding on to make things work. The implementation of shared_ptr is A LOT
more involved that one would guess.

My implementation of shared_ptr implementation may not be the only or best
one. It is pretty straight forward however in that it follows the chain of
composition - which includes shared_count.

Sorry I can't give a better answer.

Robert Ramey


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