Boost logo

Boost :

Subject: Re: [boost] How do folks test serialization code?
From: Robert Ramey (ramey_at_[hidden])
Date: 2013-08-05 15:50:04


John Maddock wrote:
>
> You mean rely on the usual streaming << >> operators?
>
> For sure I could do that, but full string conversion is crazy
> expensive compared to the byte-by-byte scheme I have now.

Hmm - I presume you've already had to implement these
operators. So you'd be done for text based archives like
text_archve and xml_archive. For these cases, I wouldn't
worry about the expense as these archives are already
slow enough due to all the streaming conversions they
do already, I doubt anyone would notice - oh and don't
forget about xml parsing. So for these archive classes:

a) performance isn't really an issue.
b) it's helpful to be able to read floats/double, etc as
human readable strings.
c) it consumes no extra development time. - it's free!

I'm thinking the only place where making special
overload would make sense would be for portable
binary archive - which as far as I know doesn't
currently support floating point types in any case.

Hmmm - maybe you want to generalize your
method to any size float/double and include it
as part of portable binary archive? That would
be great!

Robert Ramey


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