Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::trim throwing std::bad_cast exeption with custom basic_string
From: Arash Abghari (arash.abghari_at_[hidden])
Date: 2011-01-23 15:36:29


On Sun, 23 Jan 2011 18:28:21 +0200
Igor R <boost.lists_at_[hidden]> wrote:

> > It is still throwing an exception with boost 1.45. Since it's
> > working fine with MSVC10 then something must be wrong with gcc.
> > Here are the combinations which I tested so far:
> >
> > gcc 4.3.4 , boost 1.40
> > gcc 4.4.5 , boost 1.42 and 1.45
>
> The problem is not in gcc, but somewhere in std/crt. The exception is
> thrown by std::use_facet() function, which doesn't find the locale you
> passed to trim(). Since, you don't actually pass any locale, it uses
> the global one, so I don't understand why it doesn't find it...
> Anyway, try passing some locale explicitly, and see what happens:
> boost::trim(str, std::locale("English_UK"));

Now it's throwing another exception: locale::facet::_S_create_c_locale
name not valid. I tried different name like "English_UK", "en_US",
"en_GB". All of them gave me the same exception.
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net