
On Wed, 12 Aug 2009 18:09:39 -0700, Jason Dictos <jdictos@barracuda.com> wrote:
I'm looking for a way to implement a project using some copy-on-write feature, similar to how STL strings use reference counters to prevent needles copying of data. Is there anything in boost to help me out with this?
If I understand correctly, what you need is something that passes the pointer along of the object, and when a non const operation is performed on the object, a "clone" like method is called? I guess you could rework shared_ptr, and have a .get() const and a .get() non const. When the refcount is 1, .get() does not clone. Is that what you need? ps : I'm curious, why do you need copy on write? -- EA