diff --git a/filter_iterator.htm b/filter_iterator.htm index 6cdcfac..3010f9d 100644 --- a/filter_iterator.htm +++ b/filter_iterator.htm @@ -32,12 +32,12 @@ element is skipped over.
namespace boost { - template <class Predicate, class Iterator, ...> + template <class Predicate, class BaseIterator, ...> class filter_iterator_generator; - template <class Predicate, class Iterator> - typename filter_iterator_generator<Predicate, Iterator>::type - make_filter_iterator(Iterator first, Iterator last, const Predicate& p = Predicate()); + template <class Predicate, class BaseIterator> + typename filter_iterator_generator<Predicate, BaseIterator>::type + make_filter_iterator(BaseIterator first, BaseIterator last, const Predicate& p = Predicate()); }@@ -48,25 +48,20 @@ Generator The class filter_iterator_generator is a helper class who's purpose is to construct a filter iterator adaptor type. The template parameters for this class are the Predicate function object -type and the Iterator type that is being wrapped. In most +type and the BaseIterator type that is being wrapped. In most cases the associated types for the wrapped iterator can be deduced from std::iterator_traits, but in some situations the user may want to override these types, so there are also template parameters for each of the iterator's associated types.
-template <class Predicate, - class Iterator, - class Value = std::iterator_traits<Iterator>::value_type, - class Pointer = std::iterator_traits<Iterator>::pointer, - class Reference = std::iterator_traits<Iterator>::reference, - class Category = std::iterator_traits<Iterator>::iterator_category, - class Distance = std::iterator_traits<Iterator>::difference_type, +template <class Predicate, class BaseIterator, + class Value, class Pointer, class Reference, class Category, class Distance> class filter_iterator_generator { public: - typedef ... type; // the filter iterator_adaptor type - typedef ... policies_type; // the filter policies type + typedef ... type; // the resulting filter iterator_adaptor type + typedef ... policies_type; // the policies type for the iterator adaptor }@@ -113,48 +108,57 @@ The output is:
-template <class Predicate, class Iterator> -typename detail::filter_generator<Predicate, Iterator>::type -make_filter_iterator(Iterator first, Iterator last, const Predicate& p = Predicate()) +template <class Predicate, class BaseIterator> +typename detail::filter_generator<Predicate, BaseIterator>::type +make_filter_iterator(BaseIterator first, BaseIterator last, const Predicate& p = Predicate())This function provides a convenient way to create filter iterators.