13#if !defined(FIXFUSION_H)
16#include <boost/mpl/range_c.hpp>
18#include <boost/fusion/algorithm.hpp>
19#include <boost/fusion/sequence.hpp>
21template <
class Seq1,
class Seq2>
22boost::fusion::zip_view<boost::fusion::vector<Seq1&,Seq2&> >
zip2(Seq1& s1, Seq2& s2)
24 return boost::fusion::zip_view< boost::fusion::vector<Seq1&,Seq2&> >(boost::fusion::vector<Seq1&,Seq2&>(s1,s2));
27template <
class Seq1,
class Seq2,
class Func>
28void for_each2(Seq1
const& s1, Seq2& s2, Func
const& func)
31 zip_view<vector<Seq1 const&,Seq2&> > zipped(vector<Seq1 const&,Seq2&>(s1,s2));
32 for_each(zipped,func);
38template <
int first,
int last,
class Functor>
40 boost::fusion::for_each(
typename boost::mpl::range_c<int,first,last>::type(),f);
46template <
class First,
class Last>
49 return boost::fusion::iterator_range<First,Last>(first,last);
60 template <
int First,
int Last,
class Sequence>
63 typedef iterator_range<typename advance_c<typename begin<Sequence>::type,First>
::type,
64 typename advance_c<typename begin<Sequence>::type,Last>
::type>
type;
75template <
int First,
int Last,
class Sequence>
void for_each2(Seq1 const &s1, Seq2 &s2, Func const &func)
boost::fusion::zip_view< boost::fusion::vector< Seq1 &, Seq2 & > > zip2(Seq1 &s1, Seq2 &s2)
boost::fusion::result_of::make_range< First, Last, Sequence >::type make_range(Sequence &s)
Constructs a boost::fusion view that picks a certain range from a forward sequence.
boost::fusion::iterator_range< First, Last > make_iterator_range(First first, Last last)
Constructs an iterator range from two static boost::fusion iterators.
void for_range(Functor &f)
A half-open integer-range based for-loop.
A meta-function defining a boost::fusion iterator range from given sequence indices.
iterator_range< typename advance_c< typename begin< Sequence >::type, First >::type, typename advance_c< typename begin< Sequence >::type, Last >::type > type