Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2008-05-15 16:44:12

There's some confusion here, the name in name value pair is used for the
name data - not the typename.

In any case, you might try deriving from xml_oachive and re-implement the
following function:

typedef detail::common_oarchive<Archive> detail_common_oarchive;
template<class T>
void save_override(
::boost::serialization::nvp<my_type> & t,
save_start(; // includes "item" replace with whatever you
choose like "my_type" +

this->detail_common_oarchive::save_override(t.const_value(), 0);

Of course this would likely have all manner of undesired side-effects - like
changing ALL the tags for this type - not just "item". And of course it
would only work for my_type, etc.,etc.

Robert Ramey

Chris Weed wrote:
> Hi,
> I am interested in using the xml serialization code for std::vector,
> but currently it is hard-coded to name items, "item".
> Is this customizable by overloading/specializing make_nvp for my type
> to replace "item" with a type-specific name?
> I tried the following code which didn't accomplish this.
> Chris

Boost list run by bdawes at, gregod at, cpdaniel at, john at