2 #ifndef BOOST_MPL_AUX_FILTER_ITER_HPP_INCLUDED
3 #define BOOST_MPL_AUX_FILTER_ITER_HPP_INCLUDED
5 // Copyright Aleksey Gurtovoy 2000-2004
7 // Distributed under the Boost Software License, Version 1.0.
8 // (See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
11 // See http://www.boost.org/libs/mpl for documentation.
17 #include <boost/mpl/find_if.hpp>
18 #include <boost/mpl/iterator_range.hpp>
19 #include <boost/mpl/iterator_tags.hpp>
20 #include <boost/mpl/deref.hpp>
21 #include <boost/mpl/aux_/lambda_spec.hpp>
22 #include <boost/mpl/aux_/config/ctps.hpp>
23 #include <boost/type_traits/is_same.hpp>
25 namespace boost { namespace mpl {
31 , typename LastIterator
38 , typename LastIterator
41 struct next_filter_iter
43 typedef typename find_if<
44 iterator_range<Iterator,LastIterator>
48 typedef filter_iter<base_iter_,LastIterator,Predicate> type;
51 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
55 , typename LastIterator
60 typedef Iterator base;
61 typedef forward_iterator_tag category;
62 typedef typename aux::next_filter_iter<
63 typename mpl::next<base>::type
68 typedef typename deref<base>::type type;
75 struct filter_iter< LastIterator,LastIterator,Predicate >
77 typedef LastIterator base;
78 typedef forward_iterator_tag category;
84 struct filter_iter_impl
88 , typename LastIterator
93 typedef Iterator base;
94 typedef forward_iterator_tag category;
95 typedef typename next_filter_iter<
96 typename mpl::next<Iterator>::type
101 typedef typename deref<base>::type type;
106 struct filter_iter_impl< true >
110 , typename LastIterator
115 typedef Iterator base;
116 typedef forward_iterator_tag category;
122 , typename LastIterator
127 ::boost::is_same<Iterator,LastIterator>::value
128 >::template result_< Iterator,LastIterator,Predicate >
132 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
136 BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(3, aux::filter_iter)
140 #endif // BOOST_MPL_AUX_FILTER_ITER_HPP_INCLUDED