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: Rethinking... (Re: RFC: fp printing speedup...)


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.


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