
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Sebastian Redl Sent: 07 May 2007 15:32 To: boost@lists.boost.org Subject: Re: [boost] [HEAD] lexical_cast<int8_t>("127") bug?
I also recollect that I never understood why
zz = lexical_cast<int>("0xffff"); // Fails!
However I was more concerned about the floating-point
Paul A Bristow wrote: problems, now sorted out,
and I didn't waste any brain activity on it.
That's because all lexical cast does is create a string stream and use the extractor to get the value out. The int extractor doesn't parse code style integers. It just looks at the base flag (oct, dec or hex) and expects the number to be in this format.
Obvious, now you point it out - but I don't recollect this being documented. I'm sure I'll not be the last unthinking user to fall into this pit ;-) Paul --- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS pbristow@hetp.u-net.com