Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2000-09-25 11:14:44


I have quick questions about writing and reading integers for my bitint
class.

Am I right to assume that only the decimal base gets printing of signs ("-"
or "+") decimal points and thousands separators? And that the octal and
hexadecimal get none of those; they are just compact printings of a number's
binary representation (at most they get a preceding "0" or "0x" to indicate
which base).

I know that locale can provide help in determining if a character is a digit
(possibly hexadecimal), but how do I know which digit that character
represents? Without that, I might as well keep checking for ['0'..'9',
'A'..'F', 'a'..'f'] manually. But doing that means if a locale allows other
characters to be used as digits, or re-classifies some/all of the
traditional digit characters to be non-digits, I will never know about it.

Do the numeric locale facets only apply to decimal-represented numbers, or
can they help with octal and hexadecimal formats? Can these facets help
with writing/reading user-defined types, besides providing the decimal
point, thousands separator, and groupings? I know that those facets can
write or read (unsigned) longs completely, but can they help read bigger
numbers (possibly piecewise)?

-- 

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