From: Robert Ramey (ramey_at_[hidden])
Date: 2005-10-08 18:08:45
Ben Artin wrote:
> I am using boost 1.32. When I serialize a string, no metadata is
> written, as implementation_level<string> is set to primitive_type in
> serialization/string.hpp. However, when I serialize a vector<string>,
> I end up with metadata, because implementation_level<vector<string> >
> is not set anywhere and therefore defaults to object_class_info.
> Every other primitive type appears to be covered by
> BOOST_SERIALIZATION_COLLECTION_TRAITS and therefore
> implementation_level<vector<T> > is object_serializable for every
> other primitive type.
I suppose I didn't think about this when I did it. Setting
implementation_level to object_serializable rather than the default it
really just a tiny optimization. If I had thought about it more I would
have added vector<string> to the list. For now I'm not inclined to change
it for fear of creating compatibility problems with existing archives -
though "downgrading" should work fine - I just don't want to risk it now.
> My question: is this an omission; that is, should
> implementation_level<vector<string> > be object_serializable? (And
> similarly for other collections of strings.)
I suppose they should have been.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk