Boost logo

Boost :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2006-02-17 20:32:31


----- Mensaje original -----
De: Thorsten Ottosen <tottosen_at_[hidden]>
Fecha: Sábado, Febrero 18, 2006 1:17 am
Asunto: Re: [boost] [serialization] exception-safety of
        container-serialization

> David Abrahams wrote:
> > Joaquín Mª López Muñoz <joaquin_at_[hidden]> writes:
>
> >>2. It might be of interest to keep a partially recovered object.
> >>For instance, think of the situation in which a container is being
> >>marshalled thru a socket and you lose internet conectivity.
> >
> >
> > That brings up an interesting point: you have to make sure, when
> > writing deserialization for a class, that partial deserialization
> > won't leave its instances with broken invariants.
>
> Well, can't we think if deserialization as just another way of
> constructing an object?
>
> So if deserialization fails, it's like when construction fails and
> you
> might throw or abort. No?
>

No, IMHO. There's a crucial difference with failed
construction: if a ctor fails the object does not
even come into existence. When loading fails, the object
into which the loading process was performed exists
and should at least honor its invariants.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


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