delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2005/05/21/02:46:35

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Trace-PostClient-IP: 68.147.129.203
From: Brian Inglis <Brian DOT Inglis AT SystematicSW DOT Invalid>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: ctype<char> custom table lookup in C++
Organization: Systematic Software
Message-ID: <r9lt81t19p6u66up36tqedcmq0j1g1enhs@4ax.com>
References: <1116546092 DOT 867392 DOT 97940 AT g43g2000cwa DOT googlegroups DOT com> <3f5juoF5og3rU2 AT news DOT dfncis DOT de> <1116623500 DOT 248605 DOT 257880 AT f14g2000cwb DOT googlegroups DOT com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Lines: 39
Date: Sat, 21 May 2005 06:34:15 GMT
NNTP-Posting-Host: 24.71.223.147
X-Complaints-To: abuse AT shaw DOT ca
X-Trace: pd7tw3no 1116657255 24.71.223.147 (Sat, 21 May 2005 00:34:15 MDT)
NNTP-Posting-Date: Sat, 21 May 2005 00:34:15 MDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On 20 May 2005 14:11:40 -0700 in comp.os.msdos.djgpp, "Carey Evans"
<carey DOT evans AT gmail DOT com> wrote:

>Hans-Bernhard Broeker wrote:
>[...]
>> I find it hard to believe the C++ would actually predefine the
>> implemention of a given feature.  That's none of their business.

How the expression looks says little about how it may be implemented
in C++. 

>Here's the bit of the spec I quoted:
>
>  http://www.cantrip.org/lib-locales.html#lib.facet.ctype.char.members
>
>As far as I can tell, it's defined that way so that the table may be
>customised in a subclass.  There's nothing that says that the table()
>method has to return __dj_ctype_flags or the equivalent table by
>default, though; it just has to return some variation that works when
>the character is cast to unsigned char as an index.  In DJGPP's case,
>this is __dj_ctype_flags + 1.
>
>[...]
>> 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.
>
>The C++ ctype classes don't support passing EOF; valid input values are
>CHAR_MIN to CHAR_MAX, inclusive.

The table operator[] could be defined to check the values, then throw
an exception, or return the c + 1 entry from the real table. 

-- 
Thanks. Take care, Brian Inglis 	Calgary, Alberta, Canada

Brian DOT Inglis AT CSi DOT com 	(Brian[dot]Inglis{at}SystematicSW[dot]ab[dot]ca)
    fake address		use address above to reply

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019