Fix non-const version of Common::String::begin.

Common::String::begin now assures the storage is a unique one, i.e. there are
no other Common::String objects pointing at it. This allows for safe use of
the writable iterators (and thus fixes the test case added with my last commit)

svn-id: r49323
This commit is contained in:
Johannes Schickel 2010-05-30 13:10:44 +00:00
parent 0e9156c7c4
commit f02e31f2fc

View File

@ -222,6 +222,12 @@ public:
typedef const char * const_iterator;
iterator begin() {
// Since the user could potentionally
// change the string via the returned
// iterator we have to assure we are
// pointing to an unique storage.
makeUnique();
return _str;
}