merge from trunk

[SVN r56178]
This commit is contained in:
Joel de Guzman
2009-09-14 07:40:39 +00:00
parent ea5ea7f001
commit 2f8b91828b
22 changed files with 295 additions and 51 deletions

View File

@ -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>