Must a C++ implementation set the chars '0'-'9' to have contiguous numeric values, i.e. so that:
'0' -> 0+n
'1' -> 1+n
m -> m+n
'9' -> 9+n
I cannot find it mentioned in the documentation of isdigit
([classification] (22.3.3.1 Character classification)) *,
nor can I find it in the locale documentation (but maybe I did not look hard enough).
In 2.3 Character sets, we find that
The basic source character set consists of 96 characters: the space character, the control characters representing horizontal tab, vertical tab, form feed, and new-line, plus the following 91 graphical characters
But it doesn't mention any ordering (but maybe I did not look hard enough).
*: Interesting footnote there:
When used in a loop, it is faster to cache the ctype<> facet and use it directly [instead of isdigit() et al, end comment], or use the vector form of ctype<>::is.
This question is not a good fit to our Q&A format. We expect answers to generally involve facts, references, or specific expertise; this question will likely solicit opinion, debate, arguments, polling, or extended discussion.
I have facts, references, specific expertise, and the answer will probably not involve solicit opinion, debate, argument, polling, but prolly a reference into the standard, so no extended discussion either? Is someone high of mod-powers? – PerilⅯ
;) ) – Aspectual