This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Named locales not ok for locales without thousands separator
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: Nathan Myers <ncm-nospam at cantrip dot org>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Mon, 28 Jan 2002 09:55:42 +0100
- Subject: Re: Named locales not ok for locales without thousands separator
- References: <3C54A1EB.D452C85D@unitus.it> <20020128013843.A68031@cantrip.org>
Nathan Myers wrote:
>What does it mean for a locale to have "no" thousands separator?
>The thousands_sep() member function has no choice but to return
>a character. (The grouping() member function can return an empty
>string, in which case the thousands separator isn't used.)
>
Now perhaps I'm beginning to get your point. I was sidetracked by the C
way of dealing with this issue (the corresponding libc function may well
return the empty string). Therefore, if I understand well what you are
explaining to me, I'm puzzled as to how the following snippet is
supposed to work:
locale loc("");
const numpunct<char>& np =
use_facet<numpunct<char> >(loc);
cout << "Thousands separator = "
<< np.thousands_sep() << endl;
that is, for it_IT or fr_FR, roughly speaking nothing is printed but if
thousand_sep() return in any case a char, which one in this case???
Cheers,
Paolo.