From 6d22c99f2e8741acb889980891ce051525ca6d5a Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Fri, 8 Feb 2013 17:32:05 +0000 Subject: [PATCH] Make find_iterator work with forward iterators; refs #7989 [SVN r82788] --- include/boost/algorithm/string/find_iterator.hpp | 6 ++++-- string/test/split_test.cpp | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/algorithm/string/find_iterator.hpp b/include/boost/algorithm/string/find_iterator.hpp index 07a909e..e8cede5 100644 --- a/include/boost/algorithm/string/find_iterator.hpp +++ b/include/boost/algorithm/string/find_iterator.hpp @@ -134,8 +134,10 @@ namespace boost { { if(m_Match.begin() == m_Match.end()) m_Match=this->do_find(m_Match.end(),m_End); - else - m_Match=this->do_find(m_Match.begin()+1,m_End); + else { + input_iterator_type last = m_Match.begin(); + m_Match=this->do_find(++last,m_End); + } } // comparison diff --git a/string/test/split_test.cpp b/string/test/split_test.cpp index 1f26141..429f3c4 100644 --- a/string/test/split_test.cpp +++ b/string/test/split_test.cpp @@ -181,12 +181,10 @@ void iterator_test() BOOST_CHECK(siter==split_iterator(siter)); BOOST_CHECK(siter==split_iterator()); -#if 0 // Make sure we work with forward iterators // See bug #7989 list l1; find_iterator::iterator> liter=make_find_iterator(l1, first_finder("xx")); -#endif } BOOST_AUTO_TEST_CASE( test_main )