From: Jens Maurer (Jens.Maurer_at_[hidden])
Date: 2000-11-17 15:48:27
Beman Dawes wrote:
> save<Writer, container parms...>(writer, container)
> save<Writer, ForwardIterator>(writer, first, last)
> save<Writer,T>(writer, object)
> * Overloading of the name "save" at three different levels
> is confusing. Rename them?
The point is that these are not really three different levels:
A container is just another object, and an element of a
container may in turn be yet another container etc.
So the first and third level in the above list have to be
named the same. I could rename the second level to save_sequence()
or so, ok.
Further thoughts about XTL vs persistence.hpp:
- I like the unified reading/writing approach of XTL, and I think
I am going remodel my stuff for that. Describing user-defined
composite objects just once for e.g. easy C-style structs saves half
of the work if you don't have to do it for both reading and writing.
A user should always have the option to provide separate reading
and writing strategies for complex objects such as containers, though.
- In addition to optional unified reading/writing at the object structure
description level, it is also nice to have reading and writing
unified for the output format description level. For example, string
delimiters or begin/end markers for sequences should be the same
for reading and writing. Thinking a bit further about it, the reading
side should probably not have a "this is the delimiter" style
function, but an "eat the delimiter" interface to allow for some
fuzz factor when reading. (regex may come in handy for specific
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk