From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Kanze To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: libstdc++/4458 Date: Sun, 28 Oct 2001 02:16:00 -0000 Message-id: <20011028101600.20949.qmail@sourceware.cygnus.com> X-SW-Source: 2001-10/msg00600.html List-Id: The following reply was made to PR libstdc++/4458; it has been noted by GNATS. From: James Kanze To: Martin Sebor Cc: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Subject: Re: libstdc++/4458 Date: 28 Oct 2001 12:16:01 +0100 Martin Sebor writes: |> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4458&database=gcc |> |> It's not required to do so for efficiency (see 22.2.1.3.2, p5). |> §22.2.1.1.1/1: concerning std::ctype<>::is: |> Returns: do_is(m,c) |> Can't be any clearer than that. The function do_is is required by |> the standard to be virtual, which means that the actual function |> called (and thus the actual semantics of the function is) depend on |> the dynamic type of the object. This is, after all, the whole |> point behind defining the protected virtual functions -- any other |> interpretation, and having the protected interface makes sense. |> No, you're quoting the requirement on the primary template, but your |> issue (titled std::ctype::is ...) is with the specialization |> on char. The requirement I referred you to in 22.2.1.3.2, p5 is the |> one that's relevant here. The reason for not calling the virtual |> function from the ctype::is() is, as I said earlier, for |> efficiency. I've found it now. It never occurred to me that the standard could require that a specialization have different semantics than the basic template. I guess the bug is in the standard, and not in g++. I conclude that if I want to implement the iso_8859_1 locale for ctype, it should be sufficient to provide the correct table. I don't need it for my current work, so finding time for it isn't necessarily easy, but if I can get around to it, do I have to do anything special to get it integrated into the normal g++ releases? -- James Kanze mailto:kanze@gabi-soft.de Conseils en informatique orientée objet/ Beratung in objektorientierter Datenverarbeitung Ziegelhüttenweg 17a, 60598 Frankfurt, Germany Tel. +49(0)179 2607481