X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: ctype custom table lookup in C++ Date: 20 May 2005 08:03:36 GMT Lines: 28 Message-ID: <3f5juoF5og3rU2@news.dfncis.de> References: <1116546092 DOT 867392 DOT 97940 AT g43g2000cwa DOT googlegroups DOT com> X-Trace: news.dfncis.de m98YfJ4fEwpoTZOgnNve5A29h1Tsf9ArYs/7WslxeEO8Tj5veIMpD9CpIQ X-Orig-Path: not-for-mail To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Carey Evans wrote: > I've been trying to write a custom C++ ctype facet to support the > full range of characters in codepage 850, not just ASCII. However, > I've run across a problem with the ctype::is(mask,char) lookup on > the custom table I pass to the ctype 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(__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 library macro/function. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.