From c0eebc8121d8c38a90ba26587d3ea6d25026f41b Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Fri, 10 Jul 2009 00:50:05 +0000 Subject: [PATCH] Fix #1601 [SVN r54850] --- .../boost_tuple/boost_tuple_iterator.hpp | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/include/boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp b/include/boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp index fca135e5..cf3183b1 100644 --- a/include/boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp +++ b/include/boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp @@ -14,6 +14,9 @@ #include #include #include +#include +#include +#include #include namespace boost { namespace fusion @@ -91,6 +94,39 @@ namespace boost { namespace fusion return type(iter.cons.get_tail()); } }; + + template + struct distance; + + // detail + template + struct lazy_next_distance + { + typedef + typename mpl::plus< + mpl::int_<1>, + typename distance< + typename next::type, + I2 + >::type + >::type type; + }; + + template + struct distance + { + typedef typename mpl::eval_if< + boost::is_same, + mpl::int_<0>, + lazy_next_distance + >::type type; + + static type + call(I1 const&, I2 const&) + { + return type(); + } + }; }; template