Re: [gtkmm] Glib::ustring bug?

> 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".  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 am not saying the behavior needs to be fixed.  I'm saying that this is 
an unpleasant surprise for someone who is expecting the string returned by 
raw() to be a useful std::string.  If raw() does not return a usable 
std::string (or, rather, if it's not guaranteed raw() returns a usable 
std::string), I think that ought to be mentioned in the API ref.

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