|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-03-01 09:20:21
From: "Vladimir Prus" <ghost_at_[hidden]>
> Peter Dimov wrote:
>
> > A single describe() method doesn't work for the following reasons:
> >
> > 1. const correctness.
> > 2. read/write assymetry.
> > 2a. sequence serialization:
> > 2b. versioning. When Complex version 1 is serialized as polar
coordinates
> > but version 2 is cartesian, read/write are assymetric.
>
> 'describe' alone is clearly not enough. It is still usefull. In Jens' code
it
> is possible to overload 'save'/'load' functions to do whatever you like,
but
> they default implementation use 'describe'. I suspect that for many
classes
> 'describe' will be sufficient, and I'd like to have it.
OK, but in
template<class RW> void describe(RW & rw, X & x)
{
describe(rw, x.first);
describe(rw, x.second);
}
you call describe() on x.first and x.second instead of read/write. What if
x.first is a std::vector<>?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk