Commit 5a1a4615 by Ulrich Drepper

(class basic_string): Return correct iterators in erase member functions.

From-SVN: r20906
parent 6feacd09
......@@ -227,9 +227,13 @@ public:
basic_string& erase (size_type pos = 0, size_type n = npos)
{ return replace (pos, n, (size_type)0, (charT)0); }
iterator erase(iterator p)
{ replace (p-ibegin (), 1, (size_type)0, (charT)0); selfish (); return p; }
{ size_type __o = p - begin();
replace (__o, 1, (size_type)0, (charT)0); selfish ();
return ibegin() + __o; }
iterator erase(iterator f, iterator l)
{ replace (f-ibegin (), l-f, (size_type)0, (charT)0);selfish ();return f; }
{ size_type __o = f - ibegin();
replace (__o, l-f, (size_type)0, (charT)0);selfish ();
return ibegin() + __o; }
basic_string& replace (size_type pos1, size_type n1, const basic_string& str,
size_type pos2 = 0, size_type n2 = npos);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment