Boost logo

Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2006-07-12 12:08:01


 

| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]] On Behalf Of Alexander Nasonov
| Sent: 12 July 2006 16:27
| To: boost_at_[hidden]
| Subject: Re: [boost] [lexical_cast] performace patch
|
| Alexander Nasonov wrote:
| >I googled for lexical_cast on www.open-std.org recently but
| found no proposal. Now I see it:
| >http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1973.html
|
| BTW,
|
| 1. unsetf(std::ios::skipws) is not mentioned in the doc
| 2. loopback tests may fail
|
| N1973: "If std::numeric_limits<Target>::is_specialized, the
| underlying stream precision is set according to
| std::numeric_limits<Target>::digits10 + 1, otherwise if
| std::numeric_limits<Source>::is_specialized, the underlying
| stream precision is set according to
| std::numeric_limits<Source>::digits10 + 1."
|
| See http://article.gmane.org/gmane.comp.lib.boost.devel/145097

As I said before - it is the wrong formula :-((

It gives the wrong number of digits for float and will probably also fail
for user defined types.

Since it is for TR2, it should be specified in terms of max_digits10, now
accepted for TR2.

I suggest you use the right formula from digits not digits10 for now.

If you've serialized a lot of stuff, you might be cross not to get back as
near as possible what you've saved.
And you'd probably waste a lot of time trying to find out why not.

(This is a separate issue from the double loopback failures - even in MSVC,
float loopback IS correct for ALL float values - there are few enough of
them for an exhaustive test ;-)

Paul

---
Paul A Bristow
Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB
+44 1539561830 & SMS, Mobile +44 7714 330204 & SMS
pbristow_at_[hidden]
 

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