
Paul A Bristow wrote:
For the record, as a punishment for raising this issue at the UK C++ BSI group meeting, I was tasked with raising the issue for the C++ Standards group.
Some rambling thoughts on this issue are at
http://www2.open-std.org/JTC1/SC22/WG21/docs/papers/2006/n2022.pdf
Your implementation almost certainly provides a 'proof_of_concept' for this - as if it was needed.
And I suspect more than a few will be well advised to use it - otherwise they may find to their cost (possibly considerable cost) that some archives turn out to be not readable because some floating-point calculation has produced an infinity or NaN.
If you don't do this, it would seem prudent to ensure that every floating-point serialized is checked for finiteness before writing to the archive, and worrying about what to do it any are not!
So what is needed is a "companion" facet which traps attempts to write NaNs and throws an exception. Usage of one or the other of these facets would eliminate undefined behavior. Robert Ramey
Thanks.
Paul
--- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS pbristow@hetp.u-net.com
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Johan Råde Sent: 30 July 2006 11:02 To: boost@lists.boost.org Subject: Re: [boost] [serialization] facets for non-finite numbers
Robert Ramey wrote:
Johan Råde wrote:
Johan Råde wrote:
At the suggestion of Robert Ramey's, I have put together facets for reading and writing non-finite numbers, such as infinity and not-a-number, to text streams, in a consistent and portable way.
If there is enough interest in the code, I will submit it for a mini-review, in order to have it added to the serialization lib.
Actually, I would like the other codecvt facets in boost be promoted to official status. There should be a "place" in boost for these and other facets.
Robert Ramey
--Johan Råde
New version uploaded to the vault, serialization/non_finite_num_facets.zip. This version has:
1. better handling of fomatting flags 2. more robust check for not-a-number 3. more tests 4. some minor issues have been fixed 5. various code improvements
Now I'm not going to make any more changes for a while. Got other things to do.
--Johan Råde
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
------------------------------------------------------------- -----------
_______________________________________________ Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
I think there should be a Boost facets library, with the UTF-8 codecvt facet and my non-finite number facets. There is no reason why they should be buried in the serialization library.
But I'm not the right person to take care of that. My area is scientific computing and GUI programming, and I know almost nothing about locales, facets and internationalization.
--Johan Råde
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost