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: Named locales not ok for locales without thousands separator


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.


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