From d92e09176cc02e63fb6a42f9bba3d8a18af6c99a Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Mon, 7 Jun 2004 09:53:19 +0000 Subject: [PATCH] Constructors, accepting a collection added [SVN r23040] --- .../boost/algorithm/string/find_iterator.hpp | 41 +++++++++++++++++-- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/include/boost/algorithm/string/find_iterator.hpp b/include/boost/algorithm/string/find_iterator.hpp index 6c23131..e6bc8a4 100644 --- a/include/boost/algorithm/string/find_iterator.hpp +++ b/include/boost/algorithm/string/find_iterator.hpp @@ -96,6 +96,22 @@ namespace boost { increment(); } + //! Constructor + /*! + Construct new find_iterator for a given finder + and a collection. + */ + template + find_iterator( + CollectionT& Col, + FinderT Finder ) : + detail::find_iterator_base(Finder,0), + m_Match(begin(Col),begin(Col)), + m_End(end(Col)) + { + increment(); + } + private: // iterator operations @@ -162,7 +178,7 @@ namespace boost { FinderT Finder) { return find_iterator::type>( - Collection.begin(), Collection.end(), Finder); + begin(Collection), end(Collection), Finder); } // split iterator -----------------------------------------------// @@ -216,7 +232,7 @@ namespace boost { split_iterator() {} //! Copy constructor /*! - Construct a copy of the find_iterator + Construct a copy of the split_iterator */ split_iterator( const split_iterator& Other ) : base_type(Other), @@ -226,7 +242,7 @@ namespace boost { //! Constructor /*! - Construct new find_iterator for a given finder + Construct new split_iterator for a given finder and a range. */ template @@ -241,6 +257,23 @@ namespace boost { { increment(); } + //! Constructor + /*! + Construct new split_iterator for a given finder + and a collection. + */ + template + split_iterator( + CollectionT& Col, + FinderT Finder ) : + detail::find_iterator_base(Finder,0), + m_Match(begin(Col),begin(Col)), + m_Next(begin(Col)), + m_End(end(Col)) + { + increment(); + } + private: // iterator operations @@ -312,7 +345,7 @@ namespace boost { FinderT Finder) { return split_iterator::type>( - Collection.begin(), Collection.end(), Finder); + begin(Collection), end(Collection), Finder); }