16#include <boost/mpl/equal.hpp>
17#include <boost/mpl/list.hpp>
18#include <boost/mpl/list_c.hpp>
19#include <boost/mpl/range_c.hpp>
20#include <boost/mpl/vector.hpp>
21#include <boost/mpl/vector_c.hpp>
22#include <boost/static_assert.hpp>
111typedef boost::mpl::vector_c<int, 1, 3, 5, 7>
v1;
112typedef boost::mpl::vector_c<int, 2, 4, 6, 8>
v2;
121 boost::mpl::random_access_iterator_tag
124typedef boost::mpl::begin<zip_vec_t>::type
zv_begin;
130typedef boost::mpl::next<zv_begin>::type
zv_next;
133 boost::mpl::deref<zv_next>::type, boost::mpl::vector_c<int, 3, 4>
139 boost::mpl::deref<zv_prior>::type, boost::mpl::vector_c<int, 1, 2>
141typedef boost::mpl::at< zip_vec_t, boost::mpl::int_<2> >::type
zv_at2;
144 boost::mpl::deref<zv_at2>::type, boost::mpl::vector_c<int, 5, 6>
147typedef boost::mpl::advance< zv_next, boost::mpl::int_<2> >::type
zv_at3;
150 boost::mpl::deref<zv_at3>::type, boost::mpl::vector_c<int, 7, 8>
153typedef boost::mpl::list_c<int, 1, 3, 5, 7>
l1;
154typedef boost::mpl::list_c<int, 2, 4, 6, 8>
l2;
161 boost::mpl::forward_iterator_tag
171typedef boost::mpl::vector_c<int,5,6,7,8,9,0,1,2,3,4>
v;
174 boost::mpl::advance_c<boost::mpl::begin<v>::type, 5>::type
178 boost::mpl::equal<
view, boost::mpl::range_c<int, 0, 10> >::value));
189 boost::mpl::list_c<int,2,1,3,0,2>,
190 boost::mpl::vector_c<int,11,22,33,44>
193typedef boost::mpl::begin<pv1>::type
it0;
194typedef boost::mpl::deref<it0>::type
val0;
197typedef boost::mpl::next<it0>::type
it1;
198typedef boost::mpl::deref<it1>::type
val1;
202 boost::mpl::equal<
pv1, boost::mpl::vector_c<int,33,22,44,11,33> >::value));
211typedef boost::mpl::vector_c<int, 1, 2>
v1;
213typedef boost::mpl::deref<ri0>::type
rv0;
216typedef boost::mpl::next<ri0>::type
ri1;
217typedef boost::mpl::deref<ri1>::type
rv1;
220typedef boost::mpl::next<ri1>::type
ri2;
Defines a view of a sequence that appears to alter the elements' order.
Solution to Exercise 7-0.
Solution to Exercise 7-2.
Solution to Exercise 7-3.
Solution to Exercise 7-7.
Provide utilities availble to all Chapter 7 solutions.
Tests functionality from Exercise 7-2.
boost::mpl::at< zip_vec_t, boost::mpl::int_< 2 > >::type zv_at2
BOOST_STATIC_ASSERT((boost::is_same< zip_vec_category, boost::mpl::random_access_iterator_tag >::value))
chapter7::least_refined_iterator_category< zip_vec >::type zip_vec_category
boost::mpl::vector_c< int, 1, 3, 5, 7 > v1
boost::mpl::next< zv_begin >::type zv_next
boost::mpl::list_c< int, 1, 3, 5, 7 > l1
chapter7::zip_view< zip_vec > zip_vec_t
boost::mpl::list_c< int, 2, 4, 6, 8 > l2
boost::mpl::advance< zv_next, boost::mpl::int_< 2 > >::type zv_at3
boost::mpl::vector_c< int, 2, 4, 6, 8 > v2
boost::mpl::vector< v1, v2 > zip_vec
boost::mpl::begin< zip_vec_t >::type zv_begin
boost::mpl::list< l1, l2 > zip_list
boost::mpl::deref< zv_begin >::type zv_begin_t
boost::mpl::prior< zv_next >::type zv_prior
chapter7::least_refined_iterator_category< zip_list >::type zip_list_category
Tests functionality from Exercise 7-3.
BOOST_STATIC_ASSERT((boost::mpl::equal< view, boost::mpl::range_c< int, 0, 10 > >::value))
exercise_7_3::rotate_view< v, boost::mpl::advance_c< boost::mpl::begin< v >::type, 5 >::type > view
boost::mpl::vector_c< int, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4 > v
Tests functionality from Exercise 7-6.
boost::mpl::deref< it1 >::type val1
boost::mpl::next< it0 >::type it1
permutation_view< boost::mpl::list_c< int, 2, 1, 3, 0, 2 >, boost::mpl::vector_c< int, 11, 22, 33, 44 > > pv1
boost::mpl::deref< it0 >::type val0
boost::mpl::begin< pv1 >::type it0
BOOST_STATIC_ASSERT((33==val0::value))
Tests functionality from Exercise 7-7.
boost::mpl::vector_c< int, 1, 2 > v1
boost::mpl::rend< v1 >::type ri_end
boost::mpl::next< ri0 >::type ri1
boost::mpl::prior< ri1 >::type ri1_prior
BOOST_STATIC_ASSERT((rv0::value==2))
boost::mpl::next< ri1 >::type ri2
boost::mpl::deref< ri1 >::type rv1
boost::mpl::rbegin< v1 >::type ri0
boost::mpl::deref< ri0 >::type rv0
boost::mpl::if_< boost::mpl::empty< non_random_access_iterators >, boost::mpl::random_access_iterator_tag, typenameboost::mpl::if_< boost::mpl::empty< non_bidirectional_iterators >, boost::mpl::bidirectional_iterator_tag, boost::mpl::forward_iterator_tag >::type >::type type
Alter the order sequence traversal using a sequence of positions.
Wraps corresponding elements across a sequence of sequences.
A shifted and wrapped view onto the original sequence.
Wraps any iterator with the intent of reversing the direction of next and prior.