This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Implement regex_traits::lookup_classname
- From: "Stephen M. Webb" <stephen dot webb at bregmasoft dot ca>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 13 Oct 2010 15:05:23 -0400
- Subject: Re: Implement regex_traits::lookup_classname
- References: <AANLkTik3aoAxbAhYd+rBNboWCbdaKeo8db6w+KHQa9Zr@mail.gmail.com>
- Reply-to: stephen dot webb at bregmasoft dot ca
On Wed, 2010-10-13 at 10:05 +0100, Jonathan Wakely wrote:
> Instead of just fixing libstdc++/45990 by applying the proposed
> resolution of LWG 1337 I thought I'd have a go at providing the
> missing implementation of lookup_classname.
Excellent.
> Comments would be welcome, especially regarding the fact that the WP
> talks about using bitwise or in regex_traits::isctype, whereas if
> char_class_type is a Bitmask Type then testing whether the "w" and
> "blank" elements are set requires using bitwise and, or am I missing
> something?
I think you're right. Bitwise or makes no sense in this context. I
think the WP needs to be amended.
> Because we have different values of the ctype_base::mask elements on
> different platforms, it's not trivial to simply define two more
> constants for the "w" and "blank" because we don't know which bits
> might be used already by ctype_base::mask. So I chose to use a 64-bit
> type, with the lowest two bits for the new bitmask elements and the
> rest of the value contains a ctype_base::mask value left-shifted by
> two bits.
That makes sense.
I like this patch but I'm concerned it does not allow for additional
classnames. It's good enough in that it provides the classnames
required by the standard and user-defined classnames are a hairy beast
best left undisturbed in its dark dank dungeon so I have no objections
to this implementation but I am registering a minor concern.
--
Stephen M. Webb
stephen.webb@bregmasoft.ca