Boost logo

Boost :

Subject: Re: [boost] [constrained_value] serialization
From: Robert Kawulak (robert.kawulak_at_[hidden])
Date: 2008-12-14 13:58:32


> From: Neal Becker
> >> constrained_value does not currently support serialization.
> >> 1. Should it be added to the lib?
> >> 2. What would be a suggested implementation?

The implementation for general case seems a bit tricky, because some constrained
objects (e.g., bounded_int<int, 1, 10>::type) should not be default-constructed
by the Serialization library. Therefore, if I understand correctly,
load_construct_data() /save_construct_data() should be overloaded rather than
serialize() provided (but I'm not sure about this, I haven't used Serialization
library).

> > Good questions. As to the second, would it be sensible to
> serialise the
> > value + each of the policies that is non-empty (or
> stateless)? Detection
> > of class emptiness (statelessness) is not working with all
> compilers, so
> > this would possibly be a non-portable solution. But
> otherwise users would
> > need to provide serialization support for each empty policy too.
> >
> Is it feasible to have the user select which policies to serialize?

Possibly by specialising non-member serialize() / load_construct_data()
/save_construct_data()?


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