On Wed, Sep 13, 2006 at 11:05:32PM +0200, Georg Baum wrote:

> The attached version prints this:
> 
> global has std::codecvt<boost::uint32_t> facet: 0
> global has std::ctype<boost::uint32_t> facet: 0
> global has std::num_put<boost::uint32_t> facet: 0
> newlocale has std::codecvt<boost::uint32_t> facet: 0
> newlocale has std::ctype<boost::uint32_t> facet: 1
> newlocale has std::num_put<boost::uint32_t> facet: 0
> stringstream test:
> 
> It does still not work, this time because of num_put (it does not throw, 
> because the exception is caught in operator<<.
> 
> > Incidentally, I don't think that you mean this:
> >     std::cerr << "global has std::num_put<boost::uint32_t> facet: "
> >               << std::has_facet<std::ctype<boost::uint32_t> >(global)
> >               << std::endl;
> 
> Well spotted, thanks. Enrico, please use the attached version for testing.

I cannot get it to compile using stlport, but using plain cygwin
with this version I only get a warning and obtain your same output:

$ g++ -Iboost locale-test.cpp -o locale-test
locale-test.cpp: In member function `wctype_t 
ascii_ctype_facet::M_convert_to_wmask(char) const':
locale-test.cpp:54: warning: overflow in implicit constant conversion
$ ./locale-test.exe 
global has std::codecvt<boost::uint32_t> facet: 0
global has std::ctype<boost::uint32_t> facet: 0
global has std::num_put<boost::uint32_t> facet: 0
newlocale has std::codecvt<boost::uint32_t> facet: 0
newlocale has std::ctype<boost::uint32_t> facet: 1
newlocale has std::num_put<boost::uint32_t> facet: 0
stringstream test: 
$ 

Does that mean that there is hope (thanks Angus)?

-- 
Enrico

Reply via email to