C++ Template Metaprogramming
Solutions to the exercises throughout the book
Loading...
Searching...
No Matches
chapter-7.cpp File Reference

Test application for Chapter 7. More...

#include "exercise-7-0.hpp"
#include "exercise-7-2.hpp"
#include "exercise-7-3.hpp"
#include "exercise-7-7.hpp"
#include "chapter-7-permutation_view.hpp"
#include <boost/mpl/equal.hpp>
#include <boost/mpl/list.hpp>
#include <boost/mpl/list_c.hpp>
#include <boost/mpl/range_c.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/vector_c.hpp>
#include <boost/static_assert.hpp>

Go to the source code of this file.

Namespaces

namespace  test_7_2
 Tests functionality from Exercise 7-2.
 
namespace  test_7_3
 Tests functionality from Exercise 7-3.
 
namespace  test_7_6
 Tests functionality from Exercise 7-6.
 
namespace  test_7_7
 Tests functionality from Exercise 7-7.
 

Typedefs

typedef boost::mpl::vector_c< int, 1, 3, 5, 7 > test_7_2::v1
 
typedef boost::mpl::vector_c< int, 2, 4, 6, 8 > test_7_2::v2
 
typedef boost::mpl::vector< v1, v2 > test_7_2::zip_vec
 
typedef chapter7::zip_view< zip_vec > test_7_2::zip_vec_t
 
typedef chapter7::least_refined_iterator_category< zip_vec >::type test_7_2::zip_vec_category
 
typedef boost::mpl::begin< zip_vec_t >::type test_7_2::zv_begin
 
typedef boost::mpl::deref< zv_begin >::type test_7_2::zv_begin_t
 
typedef boost::mpl::next< zv_begin >::type test_7_2::zv_next
 
typedef boost::mpl::prior< zv_next >::type test_7_2::zv_prior
 
typedef boost::mpl::at< zip_vec_t, boost::mpl::int_< 2 > >::type test_7_2::zv_at2
 
typedef boost::mpl::advance< zv_next, boost::mpl::int_< 2 > >::type test_7_2::zv_at3
 
typedef boost::mpl::list_c< int, 1, 3, 5, 7 > test_7_2::l1
 
typedef boost::mpl::list_c< int, 2, 4, 6, 8 > test_7_2::l2
 
typedef boost::mpl::list< l1, l2 > test_7_2::zip_list
 
typedef chapter7::least_refined_iterator_category< zip_list >::type test_7_2::zip_list_category
 
typedef boost::mpl::vector_c< int, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4 > test_7_3::v
 
typedef exercise_7_3::rotate_view< v, boost::mpl::advance_c< boost::mpl::begin< v >::type, 5 >::type > test_7_3::view
 
typedef permutation_view< boost::mpl::list_c< int, 2, 1, 3, 0, 2 >, boost::mpl::vector_c< int, 11, 22, 33, 44 > > test_7_6::pv1
 
typedef boost::mpl::begin< pv1 >::type test_7_6::it0
 
typedef boost::mpl::deref< it0 >::type test_7_6::val0
 
typedef boost::mpl::next< it0 >::type test_7_6::it1
 
typedef boost::mpl::deref< it1 >::type test_7_6::val1
 
typedef boost::mpl::vector_c< int, 1, 2 > test_7_7::v1
 
typedef boost::mpl::rbegin< v1 >::type test_7_7::ri0
 
typedef boost::mpl::deref< ri0 >::type test_7_7::rv0
 
typedef boost::mpl::next< ri0 >::type test_7_7::ri1
 
typedef boost::mpl::deref< ri1 >::type test_7_7::rv1
 
typedef boost::mpl::next< ri1 >::type test_7_7::ri2
 
typedef boost::mpl::rend< v1 >::type test_7_7::ri_end
 
typedef boost::mpl::prior< ri1 >::type test_7_7::ri1_prior
 

Functions

 test_7_2::BOOST_STATIC_ASSERT ((boost::is_same< zip_vec_category, boost::mpl::random_access_iterator_tag >::value))
 
 test_7_2::BOOST_STATIC_ASSERT ((boost::mpl::equal< zv_begin_t, boost::mpl::vector_c< int, 1, 2 > >::value))
 
 test_7_2::BOOST_STATIC_ASSERT ((boost::mpl::equal< boost::mpl::deref< zv_next >::type, boost::mpl::vector_c< int, 3, 4 > >::value))
 
 test_7_2::BOOST_STATIC_ASSERT ((boost::is_same< zv_prior, zv_begin >::value))
 
 test_7_2::BOOST_STATIC_ASSERT ((boost::mpl::equal< boost::mpl::deref< zv_prior >::type, boost::mpl::vector_c< int, 1, 2 > >::value))
 
 test_7_2::BOOST_STATIC_ASSERT ((boost::mpl::equal< boost::mpl::deref< zv_at2 >::type, boost::mpl::vector_c< int, 5, 6 > >::value))
 
 test_7_2::BOOST_STATIC_ASSERT ((boost::mpl::equal< boost::mpl::deref< zv_at3 >::type, boost::mpl::vector_c< int, 7, 8 > >::value))
 
 test_7_2::BOOST_STATIC_ASSERT ((boost::is_same< zip_list_category, boost::mpl::forward_iterator_tag >::value))
 
 test_7_3::BOOST_STATIC_ASSERT ((boost::mpl::equal< view, boost::mpl::range_c< int, 0, 10 > >::value))
 
 test_7_6::BOOST_STATIC_ASSERT ((33==val0::value))
 
 test_7_6::BOOST_STATIC_ASSERT ((22==val1::value))
 
 test_7_6::BOOST_STATIC_ASSERT ((boost::mpl::equal< pv1, boost::mpl::vector_c< int, 33, 22, 44, 11, 33 > >::value))
 
 test_7_7::BOOST_STATIC_ASSERT ((rv0::value==2))
 
 test_7_7::BOOST_STATIC_ASSERT ((rv1::value==1))
 
 test_7_7::BOOST_STATIC_ASSERT ((boost::is_same< ri2, ri_end >::value))
 
 test_7_7::BOOST_STATIC_ASSERT ((boost::is_same< ri1_prior, ri0 >::value))
 
int main ()
 

Detailed Description

Test application for Chapter 7.

Author
Matt Bisson

Definition in file chapter-7.cpp.

Function Documentation

◆ main()

int main ( )

Definition at line 230 of file chapter-7.cpp.