Boost logo

Boost Users :

From: Alexander (gutenev_at_[hidden])
Date: 2008-07-31 09:26:11


> 1) Yes, but as you note it's trivial to add if it's important. I had that
> in my own implementation of intrusive_ptr (before those were in Boost) but
> dropped it because I never used it. Not such a big deal on Win32, but I
> remember it being painful on Sun / Sparc systems (am I dating myself?).

boost::shared_ptr have reference counting for various platforms, and there's
no policy to have custom reference counter, so, although I've never coded
for Sun / Sparc systems, it seems possible to do what boost::shared_ptr
does.

> 3) A design feature for me. It makes copy on write semantics easier to
> implement. You might consider putting in "bool is_shared() const { return
> m_reference_counter > 1; }" for that case.

I would rather put "bool is_shared() const { return m_reference_counter >
1; }" as protected member, and m_reference_counter as private one. Do you
need it for something like "intrusive_from_this()" form Boost.Statechart ?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net