Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:41:38

0001 
0002 #ifndef BOOST_MPL_AUX_JOINT_ITER_HPP_INCLUDED
0003 #define BOOST_MPL_AUX_JOINT_ITER_HPP_INCLUDED
0004 
0005 // Copyright Aleksey Gurtovoy 2000-2004
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. 
0008 // (See accompanying file LICENSE_1_0.txt or copy at 
0009 // http://www.boost.org/LICENSE_1_0.txt)
0010 //
0011 // See http://www.boost.org/libs/mpl for documentation.
0012 
0013 // $Id$
0014 // $Date$
0015 // $Revision$
0016 
0017 #include <boost/mpl/next_prior.hpp>
0018 #include <boost/mpl/deref.hpp>
0019 #include <boost/mpl/iterator_tags.hpp>
0020 #include <boost/mpl/aux_/lambda_spec.hpp>
0021 #include <boost/mpl/aux_/config/ctps.hpp>
0022 
0023 #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
0024 #   include <boost/type_traits/is_same.hpp>
0025 #endif
0026 
0027 namespace boost { namespace mpl {
0028 
0029 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
0030 
0031 template<
0032       typename Iterator1
0033     , typename LastIterator1
0034     , typename Iterator2
0035     >
0036 struct joint_iter
0037 {
0038     typedef Iterator1 base;
0039     typedef forward_iterator_tag category;
0040 };
0041 
0042 template<
0043       typename LastIterator1
0044     , typename Iterator2
0045     >
0046 struct joint_iter<LastIterator1,LastIterator1,Iterator2>
0047 {
0048     typedef Iterator2 base;
0049     typedef forward_iterator_tag category;
0050 };
0051 
0052 
0053 template< typename I1, typename L1, typename I2 >
0054 struct deref< joint_iter<I1,L1,I2> >
0055 {
0056     typedef typename joint_iter<I1,L1,I2>::base base_;
0057     typedef typename deref<base_>::type type;
0058 };
0059 
0060 template< typename I1, typename L1, typename I2 >
0061 struct next< joint_iter<I1,L1,I2> >
0062 {
0063     typedef joint_iter< typename mpl::next<I1>::type,L1,I2 > type;
0064 };
0065 
0066 template< typename L1, typename I2 >
0067 struct next< joint_iter<L1,L1,I2> >
0068 {
0069     typedef joint_iter< L1,L1,typename mpl::next<I2>::type > type;
0070 };
0071 
0072 #else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
0073 
0074 template<
0075       typename Iterator1
0076     , typename LastIterator1
0077     , typename Iterator2
0078     >
0079 struct joint_iter;
0080 
0081 template< bool > struct joint_iter_impl
0082 {
0083     template< typename I1, typename L1, typename I2 > struct result_
0084     {
0085         typedef I1 base;
0086         typedef forward_iterator_tag category;
0087         typedef joint_iter< typename mpl::next<I1>::type,L1,I2 > next;
0088         typedef typename deref<I1>::type type;
0089     };
0090 };
0091 
0092 template<> struct joint_iter_impl<true>
0093 {
0094     template< typename I1, typename L1, typename I2 > struct result_
0095     {
0096         typedef I2 base;
0097         typedef forward_iterator_tag category;
0098         typedef joint_iter< L1,L1,typename mpl::next<I2>::type > next;
0099         typedef typename deref<I2>::type type;
0100     };
0101 };
0102 
0103 template<
0104       typename Iterator1
0105     , typename LastIterator1
0106     , typename Iterator2
0107     >
0108 struct joint_iter
0109     : joint_iter_impl< is_same<Iterator1,LastIterator1>::value >
0110         ::template result_<Iterator1,LastIterator1,Iterator2>
0111 {
0112 };
0113 
0114 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
0115 
0116 BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(3, joint_iter)
0117 
0118 }}
0119 
0120 #endif // BOOST_MPL_AUX_JOINT_ITER_HPP_INCLUDED