Why do Glib::ustring::operator[] and at() return values, not references?



Title says it all really. I had to use an std::string in one place because I needed to modify it quickly and with less hassle than using .replace() - and Glib::ustring won't let me get a reference to perform such modification.

The documentation states
    "No reference return; use replace() to write characters."
but does not explain why, nor does the commit log: these comments were added way back in the initial revision.

So I'm wondering whether there's really a reason for this, or if it is just something that no one has wanted to change (until now!)



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