Ticket #1601: boost_tuple_iterator.hpp.patch

File boost_tuple_iterator.hpp.patch, 1.6 KB (added by Stjepan Rajko, 13 years ago)

fix for ticket

  • boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp

     
    1414#include <boost/mpl/if.hpp>
    1515#include <boost/mpl/eval_if.hpp>
    1616#include <boost/mpl/or.hpp>
     17#include <boost/mpl/plus.hpp>
     18#include <boost/mpl/int.hpp>
     19#include <boost/mpl/apply.hpp>
    1720#include <boost/tuple/tuple.hpp>
    1821
    1922namespace boost { namespace fusion
     
    9194                return type(iter.cons.get_tail());
    9295            }
    9396        };
     97       
     98        template <typename I1, typename I2>
     99        struct distance;
     100
     101        // detail
     102        template <typename I1, typename I2>
     103        struct lazy_next_distance
     104        {
     105            typedef
     106                typename mpl::plus<
     107                    mpl::int_<1>,
     108                    typename distance<
     109                        typename next<I1>::type,
     110                        I2
     111                    >::type
     112                >::type type;
     113        };
     114       
     115        template <typename I1, typename I2>
     116        struct distance
     117        {
     118            typedef typename mpl::eval_if<
     119                boost::is_same<I1, I2>,
     120                mpl::int_<0>,
     121                lazy_next_distance<I1, I2>
     122            >::type type;
     123           
     124            static type
     125            call(I1 const&, I2 const&)
     126            {
     127                return type();
     128            }
     129        };
    94130    };
    95131
    96132    template <typename Null>