2 #ifndef BOOST_MPL_AUX_JOINT_ITER_HPP_INCLUDED
\r
3 #define BOOST_MPL_AUX_JOINT_ITER_HPP_INCLUDED
\r
5 // Copyright Aleksey Gurtovoy 2000-2004
\r
7 // Distributed under the Boost Software License, Version 1.0.
\r
8 // (See accompanying file LICENSE_1_0.txt or copy at
\r
9 // http://www.boost.org/LICENSE_1_0.txt)
\r
11 // See http://www.boost.org/libs/mpl for documentation.
\r
13 // $Id: joint_iter.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
\r
14 // $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
\r
15 // $Revision: 49267 $
\r
17 #include <boost/mpl/next_prior.hpp>
\r
18 #include <boost/mpl/deref.hpp>
\r
19 #include <boost/mpl/iterator_tags.hpp>
\r
20 #include <boost/mpl/aux_/lambda_spec.hpp>
\r
21 #include <boost/mpl/aux_/config/ctps.hpp>
\r
23 #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
\r
24 # include <boost/type_traits/is_same.hpp>
\r
27 namespace boost { namespace mpl {
\r
29 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
\r
33 , typename LastIterator1
\r
34 , typename Iterator2
\r
38 typedef Iterator1 base;
\r
39 typedef forward_iterator_tag category;
\r
43 typename LastIterator1
\r
44 , typename Iterator2
\r
46 struct joint_iter<LastIterator1,LastIterator1,Iterator2>
\r
48 typedef Iterator2 base;
\r
49 typedef forward_iterator_tag category;
\r
53 template< typename I1, typename L1, typename I2 >
\r
54 struct deref< joint_iter<I1,L1,I2> >
\r
56 typedef typename joint_iter<I1,L1,I2>::base base_;
\r
57 typedef typename deref<base_>::type type;
\r
60 template< typename I1, typename L1, typename I2 >
\r
61 struct next< joint_iter<I1,L1,I2> >
\r
63 typedef joint_iter< typename mpl::next<I1>::type,L1,I2 > type;
\r
66 template< typename L1, typename I2 >
\r
67 struct next< joint_iter<L1,L1,I2> >
\r
69 typedef joint_iter< L1,L1,typename mpl::next<I2>::type > type;
\r
72 #else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
\r
76 , typename LastIterator1
\r
77 , typename Iterator2
\r
81 template< bool > struct joint_iter_impl
\r
83 template< typename I1, typename L1, typename I2 > struct result_
\r
86 typedef forward_iterator_tag category;
\r
87 typedef joint_iter< typename mpl::next<I1>::type,L1,I2 > next;
\r
88 typedef typename deref<I1>::type type;
\r
92 template<> struct joint_iter_impl<true>
\r
94 template< typename I1, typename L1, typename I2 > struct result_
\r
97 typedef forward_iterator_tag category;
\r
98 typedef joint_iter< L1,L1,typename mpl::next<I2>::type > next;
\r
99 typedef typename deref<I2>::type type;
\r
105 , typename LastIterator1
\r
106 , typename Iterator2
\r
109 : joint_iter_impl< is_same<Iterator1,LastIterator1>::value >
\r
110 ::template result_<Iterator1,LastIterator1,Iterator2>
\r
114 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
\r
116 BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(3, joint_iter)
\r
120 #endif // BOOST_MPL_AUX_JOINT_ITER_HPP_INCLUDED
\r