Boost logo

Boost :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2004-04-25 13:34:34

----- Mensaje original -----
De: Jeff Garland <jeff_at_[hidden]>
Fecha: Domingo, Abril 25, 2004 0:37 am
Asunto: [boost] [serialization+date_time] Serialization Review: serialization of dates

> All -
> Since I'm the review manager I'm not doing a formal review of the
> library, but
> I thought I'd share some code and a few thoughts. If
> serialization is
> accepted users people will ask me and other library authors to provide
> serialization support for some of the types in their libraries. So
> to get a
> feel for the difficulty of extending serialization for new types I
> wrote the
> serialization code for gregorian::date and some example code to
> try it out.

Regarding the need to include "greg_serialize.hpp", I think
a better approach, from the point of view of the user, is
that serialization support is already embedded into
"boost/date_time/gregorian/gregorian_types.hpp" and
automatically provided if one of the archive headers
are included by the user program:

// case 1


int main()
  date d(2004,Apr,25);
  boost::archive::text_oarchive oa(ofs);
  // does not work, text_oarchive not defined.
  oa << d;

// case 2

#include <boost/archive/text_oarchive.hpp>

int main()
  date d(2004,Apr,25);
  boost::archive::text_oarchive oa(ofs);
  // OK, no need to include anything else fromd date-time
  oa << d;

See what I mean? For this to work with minimum
overhead, we'd need some forward headers for serialize,
save, load, etc. to be included by

I'm not sure whether this forward headers are already
provided by Robert's library.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo

Unsubscribe & other changes:

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