Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2004-04-26 09:51:43


Andreas Huber wrote:
[snip]
> Even if one uses serialization in conjunction with e.g. network
> communication? "archive" doesn't sound right to me in this environment.

Good point. John Nagel's post at:

http://groups.google.com/groups?q=g:thl3471000725d&dq=&hl=en&lr=&ie=UTF-8&oe=UTF-8&scoring=d&selm=e7Thc.54263%24VK6.45375%40newssvr25.news.prodigy.com

suggests he might be interested in such a "marshalling" application of
this serializer library.

> IMHO, "serializer" would be much better because it does not make any
> suggestions where the data is going to end up.
> However, since I seem to be the only one with these concerns I won't push this
> any further.

Although I haven't looked closely at serialization, I think Andreas
makes a good point. In addition, it was not at first apparent to me
that although:

   struct A{int i, char c};

is laid out in memory with c following i, the serializer could just
as well store it as i following c. The secret being that only
one templated serialize function is used to both store and load,
with the store or load operation selected by the Archive template
parameter. I admit that if I'd read last paragraph under the
Free Function section, I would have realized that.

This raises another minor point. At first, when I saw:

   ar & degrees;

in member function:

   void gps_position::serialize(Archive & ar, const unsigned int version)

I jumped to the conclusion that this was a declaration. Maybe something
like:

   ar &= degrees;

would make the statement's intention less mistakable.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk