Rethinking... (Re: RFC: fp printing speedup...)

Paolo Carlini pcarlini@unitus.it
Fri Nov 14 17:03:00 GMT 2003


Martin Sebor wrote:

> If I understand the issue correctly, the test case probably needs
> to make sure that results returned from both forms of widen() are
> consistent, even though the standard doesn't seem to explicitly
> require it (there are a number of other inconsistencies in locale
> due to this).

FYI, you posted something very similar to the testcase in the PR
in the STLPort forum, circa December, 2002:

#include <iostream>
#include <locale>

struct Ctype: std::ctype<char>
{
char do_widen(char c) const {
  return 'A' + c % 26;
}
};

int main()
{
  std::locale loc(std::locale::classic(), new Ctype);
  loc = std::cout.imbue(loc);
  std::cout << 123 << '\n';
  std::cout.imbue(loc);
}

If you basically concur with Nathan that using widen(array) is correct
I will close the PR immediately, otherwise perhaps suspend it 'til the
DR is really there...

Out of curiosity, can you tell us what your library does?

Paolo.



More information about the Libstdc++ mailing list