Index: boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp =================================================================== --- boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp (revision 51780) +++ boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp (working copy) @@ -14,6 +14,9 @@ #include #include #include +#include +#include +#include #include namespace boost { namespace fusion @@ -91,6 +94,39 @@ 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