mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-21 00:02:42 +02:00
@ -14,6 +14,9 @@
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/or.hpp>
|
||||
#include <boost/mpl/plus.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/apply.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
@ -91,6 +94,39 @@ namespace boost { namespace fusion
|
||||
return type(iter.cons.get_tail());
|
||||
}
|
||||
};
|
||||
|
||||
template <typename I1, typename I2>
|
||||
struct distance;
|
||||
|
||||
// detail
|
||||
template <typename I1, typename I2>
|
||||
struct lazy_next_distance
|
||||
{
|
||||
typedef
|
||||
typename mpl::plus<
|
||||
mpl::int_<1>,
|
||||
typename distance<
|
||||
typename next<I1>::type,
|
||||
I2
|
||||
>::type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
template <typename I1, typename I2>
|
||||
struct distance
|
||||
{
|
||||
typedef typename mpl::eval_if<
|
||||
boost::is_same<I1, I2>,
|
||||
mpl::int_<0>,
|
||||
lazy_next_distance<I1, I2>
|
||||
>::type type;
|
||||
|
||||
static type
|
||||
call(I1 const&, I2 const&)
|
||||
{
|
||||
return type();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template <typename Null>
|
||||
|
Reference in New Issue
Block a user