Re: [gtkmm] Glib::Unicode::toupper can't be used the same way as toupper



On Fri, 2002-07-12 at 16:41, Morten Brix Pedersen wrote:
> Hi,
> 
> Using std::string, I converted a string to uppercase doing this:
> 
>     std::transform(str.begin(), str.end(), str.begin(), toupper);
> 
> I tried the same thing with Glib::ustring and it's toupper function:
> 
>     std::transform(str.begin(), str.end(), str.begin(), Glib::Unicode::toupper);
> 
> However, gcc 3.1 fails with:
> 
> /usr/include/g++-v3-3.1/bits/stl_algo.h: In function `_OutputIter 
>    std::transform(_InputIter, _InputIter, _OutputIter, _UnaryOperation) [with 
>    _InputIter = Glib::ustring_Iterator<__gnu_cxx::__normal_iterator<char*, 
>    std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, 
>    _OutputIter = Glib::ustring_Iterator<__gnu_cxx::__normal_iterator<char*, 
>    std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, 
>    _UnaryOperation = gunichar (*)(unsigned int)]':

Could it be that _UnaryOperation needs to be gunichar (*)(char)
function?  Your 'str' is normal characters, so perhaps you should look
at line 744 to see what it's barfing on.

> Utils.cpp:47:   instantiated from here
> /usr/include/g++-v3-3.1/bits/stl_algo.h:744: non-lvalue in assignment
> 
>   - Morten.
> 
> --
> http://wtf.dk/
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
> 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]