Mail Archives: djgpp/2005/05/20/04:16:37
Carey Evans <carey DOT evans AT gmail DOT com> wrote:
> I've been trying to write a custom C++ ctype<char> facet to support the
> full range of characters in codepage 850, not just ASCII. However,
> I've run across a problem with the ctype<char>::is(mask,char) lookup on
> the custom table I pass to the ctype<char> constructor.
> The ISO C++ standard says of is(mask m, char c) that:
> > The first form returns table()[(unsigned char)c] & m; ...
I find it hard to believe the C++ would actually predefine the
implemention of a given feature. That's none of their business.
> but with GCC 3.4.3 in DJGPP, it returns (from ctype_inline.h):
> > _M_table[static_cast<unsigned char>(__c + 1)] & __m;
> which means that all the character classifications in my custom class
> are off by one.
Only if you misunderstand how that table is supposed to be
constructed, in the case of DJGPP. The C++ standard seems to have
forgotten about the C specialty of passing EOF into a <ctype.h>
library macro/function.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -