14#include <boost/static_assert.hpp>
16#include <boost/mpl/copy.hpp>
17#include <boost/mpl/back_inserter.hpp>
18#include <boost/mpl/equal.hpp>
19#include <boost/mpl/vector.hpp>
20#include <boost/mpl/vector_c.hpp>
43typedef boost::mpl::vector_c<int, 1, 3, 5, 7>
v1;
44typedef boost::mpl::vector_c<int, 2, 4, 6, 8>
v2;
45typedef boost::mpl::vector<v1, v2>
zip_vec;
47typedef boost::mpl::fold<
50 boost::mpl::copy<_2, boost::mpl::back_inserter<_1> >
"Zip" corresponding elements of N arrays into a sequence of N-length subsequences.
Provide utilities availble to all Chapter 7 solutions.
Encapsulate solution for Exercise 7-0.
boost::mpl::vector< v1, v2 > zip_vec
BOOST_STATIC_ASSERT((boost::mpl::equal< expected_results, folded >::value))
boost::mpl::fold< zip_view< zip_vec >, boost::mpl::vector<>, boost::mpl::copy< _2, boost::mpl::back_inserter< _1 > > >::type folded
boost::mpl::vector_c< int, 1, 3, 5, 7 > v1
boost::mpl::vector_c< int, 1, 2, 3, 4, 5, 6, 7, 8 > expected_results
boost::mpl::vector_c< int, 2, 4, 6, 8 > v2
Wraps corresponding elements across a sequence of sequences.