From 792b4eae886e2382c1897489f3067bcdf8f2dd74 Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Mon, 23 Aug 2004 18:46:28 +0000 Subject: [PATCH] Attempt to fix iterator problem detected by VC8.0 [SVN r24677] --- .../algorithm/string/detail/replace_storage.hpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/include/boost/algorithm/string/detail/replace_storage.hpp b/include/boost/algorithm/string/detail/replace_storage.hpp index 3e7726d..4d8f1e6 100644 --- a/include/boost/algorithm/string/detail/replace_storage.hpp +++ b/include/boost/algorithm/string/detail/replace_storage.hpp @@ -123,9 +123,18 @@ namespace boost { ForwardIteratorT InsertIt, ForwardIteratorT SegmentBegin, ForwardIteratorT SegmentEnd ) + { - // Call replace to do the job - replace( Input, InsertIt, SegmentBegin, Storage ); + if(InsertIt!=SegmentEnd) + { + // Call replace to do the job + replace( Input, InsertIt, SegmentBegin, Storage ); + } + else + { + // Call insert to do the job + insert( Input, InsertIt, Storage ); + } // Empty the storage Storage.clear(); // Iterators were not changed, simply return the end of segment