On 3/1/07, Wesley J. Landaker <[EMAIL PROTECTED]> wrote:
Package: libboost-dev
Version: 1.33.1-10
Severity: wishlist

Please allow lexical_cast to handle based number strings. Currently,
it only supports decimal strings, but it should be able to handle octal
and hexadecimal strings if they have correct prefix notations.

Background:
This happens because lexical_cast constructs a stringstream, which by
default has the ios_base::dec flag set. If this flag is unset, it will
still read decimal strings, but will also automatically determine the
base by looking at the prefix, so will read decimal strings if the
number starts with 0-9, octal if it starts with 0, and hex if it starts
with 0x.

Fix:
After constructing the stringstream, simply call
stringstring::unsetf(std::ios_base::basefield). Because decimal numbers
are still handled correctly, this is totally backwards compatible.

This is a really simple thing to fix, but if you need any help
implementing it, I would be happy to provide a real patch.



It's better to post this to boost's develop maillist.


--
LI Daobing


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to