Re: [Re: [gtkmm] Glib::ustring bug?]



"Robert J. Hansen" <rjhansen inav net> wrote:
> > I think you've missed the point about ustring::raw().  It does *not*
return
> > a C style string, so the fact that your code snippet worked under gcc-RH
> 
> When I see in the documentation that it returns a std::string reference, 
> the first thing that leaps into my head is "ah, it returns a std::string 
> version of its internal contents; I can use raw() to convert ustrings to 
> std::strings if the library I'm using requires them".

I think
  Glib::ustring ustr("something"),
  std::string sstr = ustr;
would be more obvious, particularly if you've read about Glib::ustring.

>  Given that in the 
> API ref, raw() is listed right alongside c_str(), which works exactly as 
> the std::string c_str(), this doesn't seem like an unreasonable inference 
> to draw.

I don't think it's sensible to infer anything from the method's location on
the page unless the methods are explicitly grouped together.


Murray Cumming
murrayc usa net
www.murrayc.com




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