Chris@16: Chris@16: #ifndef BOOST_MPL_AUX_JOINT_ITER_HPP_INCLUDED Chris@16: #define BOOST_MPL_AUX_JOINT_ITER_HPP_INCLUDED Chris@16: Chris@16: // Copyright Aleksey Gurtovoy 2000-2004 Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // See http://www.boost.org/libs/mpl for documentation. Chris@16: Chris@101: // $Id$ Chris@101: // $Date$ Chris@101: // $Revision$ Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) Chris@16: # include Chris@16: #endif Chris@16: Chris@16: namespace boost { namespace mpl { Chris@16: Chris@16: #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) Chris@16: Chris@16: template< Chris@16: typename Iterator1 Chris@16: , typename LastIterator1 Chris@16: , typename Iterator2 Chris@16: > Chris@16: struct joint_iter Chris@16: { Chris@16: typedef Iterator1 base; Chris@16: typedef forward_iterator_tag category; Chris@16: }; Chris@16: Chris@16: template< Chris@16: typename LastIterator1 Chris@16: , typename Iterator2 Chris@16: > Chris@16: struct joint_iter Chris@16: { Chris@16: typedef Iterator2 base; Chris@16: typedef forward_iterator_tag category; Chris@16: }; Chris@16: Chris@16: Chris@16: template< typename I1, typename L1, typename I2 > Chris@16: struct deref< joint_iter > Chris@16: { Chris@16: typedef typename joint_iter::base base_; Chris@16: typedef typename deref::type type; Chris@16: }; Chris@16: Chris@16: template< typename I1, typename L1, typename I2 > Chris@16: struct next< joint_iter > Chris@16: { Chris@16: typedef joint_iter< typename mpl::next::type,L1,I2 > type; Chris@16: }; Chris@16: Chris@16: template< typename L1, typename I2 > Chris@16: struct next< joint_iter > Chris@16: { Chris@16: typedef joint_iter< L1,L1,typename mpl::next::type > type; Chris@16: }; Chris@16: Chris@16: #else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION Chris@16: Chris@16: template< Chris@16: typename Iterator1 Chris@16: , typename LastIterator1 Chris@16: , typename Iterator2 Chris@16: > Chris@16: struct joint_iter; Chris@16: Chris@16: template< bool > struct joint_iter_impl Chris@16: { Chris@16: template< typename I1, typename L1, typename I2 > struct result_ Chris@16: { Chris@16: typedef I1 base; Chris@16: typedef forward_iterator_tag category; Chris@16: typedef joint_iter< typename mpl::next::type,L1,I2 > next; Chris@16: typedef typename deref::type type; Chris@16: }; Chris@16: }; Chris@16: Chris@16: template<> struct joint_iter_impl Chris@16: { Chris@16: template< typename I1, typename L1, typename I2 > struct result_ Chris@16: { Chris@16: typedef I2 base; Chris@16: typedef forward_iterator_tag category; Chris@16: typedef joint_iter< L1,L1,typename mpl::next::type > next; Chris@16: typedef typename deref::type type; Chris@16: }; Chris@16: }; Chris@16: Chris@16: template< Chris@16: typename Iterator1 Chris@16: , typename LastIterator1 Chris@16: , typename Iterator2 Chris@16: > Chris@16: struct joint_iter Chris@16: : joint_iter_impl< is_same::value > Chris@16: ::template result_ Chris@16: { Chris@16: }; Chris@16: Chris@16: #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION Chris@16: Chris@16: BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(3, joint_iter) Chris@16: Chris@16: }} Chris@16: Chris@16: #endif // BOOST_MPL_AUX_JOINT_ITER_HPP_INCLUDED