Ticket #1601: boost_tuple_iterator.hpp.patch
File boost_tuple_iterator.hpp.patch, 1.6 KB (added by , 13 years ago) |
---|
-
boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp
14 14 #include <boost/mpl/if.hpp> 15 15 #include <boost/mpl/eval_if.hpp> 16 16 #include <boost/mpl/or.hpp> 17 #include <boost/mpl/plus.hpp> 18 #include <boost/mpl/int.hpp> 19 #include <boost/mpl/apply.hpp> 17 20 #include <boost/tuple/tuple.hpp> 18 21 19 22 namespace boost { namespace fusion … … 91 94 return type(iter.cons.get_tail()); 92 95 } 93 96 }; 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 }; 94 130 }; 95 131 96 132 template <typename Null>