Boost logo

Boost Users :

From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2008-07-16 13:52:57


Please consider using the Flyweight pattern implementation, which was
shortly accepted into the boost.

The implementation can be found here:
http://www.boostpro.com/vault/index.php?direction=0&order=&directory=Patterns

As I see it, you can use this implementation to easily implement
copy-on-write job for you.

With Kind Regards,
Ovanes

On Wed, Jul 16, 2008 at 7:33 PM, Michiel Helvensteijn <
m.helvensteijn_at_[hidden]> wrote:

> I am looking for a simple way to implement copy-on-write classes.
>
> Several `copies' of an instantiation of such a class can coexist and share
> the same data in memory until someone changes their `copy' (calls a
> non-const member function). At that time, a deep copy is made and the
> change is only made in that one location. The deep copy is not needed, of
> course, if the instantiation has only one handle. All of this should be
> transparent to the user of the class.
>



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