From fa09dddc75f3cc929f7f34d0399fe0c1f250fc38 Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Thu, 26 Aug 2004 16:03:48 +0000 Subject: [PATCH] More general fix for vc8.0 [SVN r24765] --- .../algorithm/string/detail/replace_storage.hpp | 12 ++---------- include/boost/algorithm/string/detail/sequence.hpp | 9 ++++++++- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/include/boost/algorithm/string/detail/replace_storage.hpp b/include/boost/algorithm/string/detail/replace_storage.hpp index 98bfa42..bb97b87 100644 --- a/include/boost/algorithm/string/detail/replace_storage.hpp +++ b/include/boost/algorithm/string/detail/replace_storage.hpp @@ -125,16 +125,8 @@ namespace boost { ForwardIteratorT SegmentEnd ) { - if(InsertIt!=SegmentBegin) - { - // Call replace to do the job - replace( Input, InsertIt, SegmentBegin, Storage ); - } - else - { - // Call insert to do the job - insert( Input, InsertIt, Storage ); - } + // Call replace to do the job + replace( Input, InsertIt, SegmentBegin, Storage ); // Empty the storage Storage.clear(); // Iterators were not changed, simply return the end of segment diff --git a/include/boost/algorithm/string/detail/sequence.hpp b/include/boost/algorithm/string/detail/sequence.hpp index 2d5602c..76416b1 100644 --- a/include/boost/algorithm/string/detail/sequence.hpp +++ b/include/boost/algorithm/string/detail/sequence.hpp @@ -172,7 +172,14 @@ namespace boost { BOOST_STRING_TYPENAME InputT::iterator To, const InsertT& Insert ) { - replace( Input, From, To, begin(Insert), end(Insert) ); + if(From!=To) + { + replace( Input, From, To, begin(Insert), end(Insert) ); + } + else + { + insert( Input, From, begin(Insert), end(Insert) ); + } } } // namespace detail