[gtkmm] Glib::ustring::raw() -- clarification



Hi,

the whole purpose of raw() is to provide an explicit way of conversion
to std::string.  Thus,

    Glib::ustring ustr;
    std::string str = ustr;

is almost the same as

    Glib::ustring ustr;
    std::string str = ustr.raw();

raw() is sometimes useful to (a) resolve overloading ambiguities, (b) to
clarify code and (c) when performance matters (unlike operator
std::string(), raw() returns a const reference to the ustring's internal
data).

Cheers,
--Daniel





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