C++ Template Metaprogramming
Solutions to the exercises throughout the book
Loading...
Searching...
No Matches
exercise-7-0.hpp File Reference

Solution to Exercise 7-0. More...

#include "chapter-7-zip_view.hpp"
#include <boost/static_assert.hpp>
#include <boost/mpl/copy.hpp>
#include <boost/mpl/back_inserter.hpp>
#include <boost/mpl/equal.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/vector_c.hpp>

Go to the source code of this file.

Namespaces

namespace  exercise_7_0
 Encapsulate solution for Exercise 7-0.
 

Typedefs

typedef boost::mpl::vector_c< int, 1, 3, 5, 7 > exercise_7_0::v1
 
typedef boost::mpl::vector_c< int, 2, 4, 6, 8 > exercise_7_0::v2
 
typedef boost::mpl::vector< v1, v2 > exercise_7_0::zip_vec
 
typedef boost::mpl::fold< zip_view< zip_vec >, boost::mpl::vector<>, boost::mpl::copy< _2, boost::mpl::back_inserter< _1 > > >::type exercise_7_0::folded
 
typedef boost::mpl::vector_c< int, 1, 2, 3, 4, 5, 6, 7, 8 > exercise_7_0::expected_results
 

Functions

 exercise_7_0::BOOST_STATIC_ASSERT ((boost::mpl::equal< expected_results, folded >::value))
 

Detailed Description

Solution to Exercise 7-0.

Author
Matt Bisson

Definition in file exercise-7-0.hpp.