diff options
author | Ulrich Drepper <drepper@gcc.gnu.org> | 1998-07-06 10:35:56 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@gcc.gnu.org> | 1998-07-06 10:35:56 +0000 |
commit | 64e1d44458c8bfe8430870d5b931e35e233a0c0f (patch) | |
tree | f828d108c45b5e68ad80bb8d80b175c806c38f0e /libstdc++ | |
parent | 60afa297a06184e77394362b43acf13a332d64e9 (diff) | |
download | gcc-64e1d44458c8bfe8430870d5b931e35e233a0c0f.zip gcc-64e1d44458c8bfe8430870d5b931e35e233a0c0f.tar.gz gcc-64e1d44458c8bfe8430870d5b931e35e233a0c0f.tar.bz2 |
(class basic_string): Correct iterator return values in insert member
functions.
From-SVN: r20950
Diffstat (limited to 'libstdc++')
-rw-r--r-- | libstdc++/std/bastring.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libstdc++/std/bastring.h b/libstdc++/std/bastring.h index 5e334e6..f188628 100644 --- a/libstdc++/std/bastring.h +++ b/libstdc++/std/bastring.h @@ -213,9 +213,13 @@ public: basic_string& insert (size_type pos, size_type n, charT c) { return replace (pos, 0, n, c); } iterator insert(iterator p, charT c) - { insert (p - ibegin (), 1, c); selfish (); return p; } + { size_type __o = p - ibegin (); + insert (p - ibegin (), 1, c); selfish (); + return ibegin () + __o; } iterator insert(iterator p, size_type n, charT c) - { insert (p - ibegin (), n, c); selfish (); return p; } + { size_type __o = p - ibegin (); + insert (p - ibegin (), n, c); selfish (); + return ibegin () + __o; } #ifdef __STL_MEMBER_TEMPLATES template<class InputIterator> void insert(iterator p, InputIterator first, InputIterator last) |