diff options
| author | drepper <drepper@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-07-06 10:35:56 +0000 |
|---|---|---|
| committer | drepper <drepper@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-07-06 10:35:56 +0000 |
| commit | bd8dfad867a8ebeaffb6622c432e0ca4188cff5b (patch) | |
| tree | f828d108c45b5e68ad80bb8d80b175c806c38f0e /libstdc++/std | |
| parent | e3fc7f35a585c9a02d98d72e13eb5ddc0cff26c1 (diff) | |
| download | ppe42-gcc-bd8dfad867a8ebeaffb6622c432e0ca4188cff5b.tar.gz ppe42-gcc-bd8dfad867a8ebeaffb6622c432e0ca4188cff5b.zip | |
(class basic_string): Correct iterator return values in insert member
functions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@20950 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++/std')
| -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 5e334e666ff..f188628cc77 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) |

