Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2006-05-16 11:33:08


David Abrahams wrote:
> "Robert Ramey" <ramey_at_[hidden]> writes:

>> BTW - as far as the serialization system is concerned I
>> never had a problem with the idea of recovering the exact
>> kind of "undefined" data. Its just that there's no way to
>> do it with archives which might be ported from one machine
>> to another as there is no guarentee that the reading
>> machine has the same set of of undefined results as the
>> source machine.
>
> That doesn't mean there's no way to do it. I can think of any number
> of ways, including, for example, having a replaceable handler for
> translating unrepresentable values.

OK - let me rephrase. I looked into this sometime ago and could
find no way to guarentee any given type of Nan. Also. Not all
compilers support the same set of NaNs. So I could see no way
that an archive created on one machine could be loaded on
another and guarentee that the NaNs would be preserved. I
asked for help on this list and no one else could do it figure out
a way either. Too bad you didn't post to that discussion.

>> Its even worse, there is way to write portable code which will
>> generate any specific one of the "undefined" types.
>
> numeric_limits<float>::quiet_NaN()
>
> Is "reasonably portable."

hmm - what's "reasonable portable" is hard to get a concensus on.

>> One might hack
>> something together that would recover some undefined type but it
>> wouldn't be guarenteed to the the same original type of undefined
>> type.
>
> Type of undefined type?

That was a joke - sorry.

Robert Ramey


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