[RFC] First draft of the POSIX locale::name patch

Paolo Carlini pcarlini@unitus.it
Fri Oct 4 02:39:00 GMT 2002

Hi Benjamin, thanks for your feedback

>>1- _M_c_cats(__cat) contains the names of the various
>>   C categories present in recent glibc: arguably a
>>   rough approach.
>>   1a- I have no idea how to automatically adapt it (at
>>       configure time?!?) to different libc... Is this needed
>>       or in fact ;) the named locales machinery presently
>>       works well only for glibc anyway.
>>   1b- When the 6 additional categories stabilized? This
>>       is relevant for the new testcases too (some should be
>>       conditionalized to glibc >= 2.1 or >= 2.0??)
>Solution enclosed. Perhaps this should be two separate arrays, not one
>combined one.
I like your improvements! In particular the config bits which, with all 
evidence, I never do right :-(

>>2- Is there a clean way to avoid strtok() in
>>   locale::_Impl::_Impl(const char*, size_t) not changing
>>   to much the infrastructure?
>I'll look at this next
Indeed, currently _Impl::_Impl(const char*, size_t) is passed the "C" 
string in order for it to call the underlying locale, but then all the 
information about the individual categories must be extracted from it 
via strtok. This is a pity, since it was available not mangled in 
locale::locale(const char*).

Ciao, Paolo.

More information about the Libstdc++ mailing list