This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Implement regex_traits::lookup_classname


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]