This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [RFA] Processing locale::_M_names decently fast
- From: Martin Sebor <sebor at roguewave dot com>
- To: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Fri, 30 Apr 2004 16:15:25 -0600
- Subject: Re: [RFA] Processing locale::_M_names decently fast
- References: <40922339.3070502@suse.de>
Paolo Carlini wrote:
...
At the root of the idea is the observation that I already tried to present
yesterday (not completely succesfully): if a locale has no name it can't
acquire one piecewise, one category at a time, producing something like
LC_CTYPE=*;LC_NUMERIC=de_DE;LC_TIME=*;...
in the process. Or not?
I'm not sure whether you don't think it might be useful to construct
such a locale or if you overlooked the similarity with what we talked
about yesterday. There is a ctor that combines whole categories from
two locales. So even if neither of the two locale being combined has
a name, the resulting combined locale may still have one as long as
the categories it's being combined from each consists of (byname)
facets from the same named locale, or from the base facets.
For example, given two unnamed locales looking like this (where
the splats denote categories consisting of facets from two or
more different locales):
COLLATE CTYPE MESSAGES MONETARY NUMERIC TIME
locale_1: * de de de de de
locale_2: de * * * * *
You can construct a combined locale from them by invoking the ctor:
locale combined = locale (locale_1, locale_2, LC_COLLATE)
and end up with a locale that can have the simple name "de":
combined: de de de de de de
This, also, is contrary to what the standard currently requires.
Martin
This is a **much** weaker requirement than allowing locale::combine(loc)
to produce a named locale if *this and loc have a name and Facet is a
standard facet (as discussed with Martin).
If nobody finds a fundamental flaw in my sketch, I'll try to implement
it soon.
Paolo.