From: Fernando Cacciola (fernando_cacciola_at_[hidden])
Date: 2002-11-05 16:22:22


----- Original Message -----
From: "Gennaro Prota" <gennaro_prota_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, November 01, 2002 2:57 PM
Subject: [boost] Re: Boost Array: read/write access to entire data

> On Wed, 30 Oct 2002 14:46:51 -0300, "Fernando Cacciola"
> <fernando_cacciola_at_[hidden]> wrote:
>
> >Look for the threads [...] specially at the participation from Anthony
> >Williams who brought up the technique I was referring to.
>
>
> I gave it a look. The technique is remarkable, and IMHO useful when a
> discriminated union is needed/opportune by design.
>
I also think it is useful for the case when you have more than one object
and you don't know how to perform a (no throw) move/swap of those objects.
That is, if you have:

T[0]
T[1]
...

How do you implement no-throw swapping without a transacted approach (so
that you can rollback state in case of an exception)?

The double buffer would allow you to have no-throw swap in the array even if
you don't have it in the objects themselves.

Fernando Cacciola