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

Solution to Exercise 6-1. More...

#include <boost/static_assert.hpp>
#include <boost/mpl/accumulate.hpp>
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/iterator_tags.hpp>
#include <boost/mpl/next_prior.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/mpl/plus.hpp>
#include <boost/mpl/times.hpp>

Go to the source code of this file.

Classes

struct  exercise_6_1::binary_tag
 A tag for tag-dispatched sequence metafunctions. More...
 
struct  boost::mpl::next< exercise_6_1::binary< N > >
 Strip the least-significant binary digit from the number. More...
 
struct  boost::mpl::deref< exercise_6_1::binary< N > >
 Algorithms require the full binary type for computations. More...
 
struct  boost::mpl::begin_impl< exercise_6_1::binary_tag >
 Simply return the binary type as is. More...
 
struct  boost::mpl::begin_impl< exercise_6_1::binary_tag >::apply
 
struct  boost::mpl::begin_impl< exercise_6_1::binary_tag >::apply< exercise_6_1::binary< N > >
 
struct  boost::mpl::end_impl< exercise_6_1::binary_tag >
 When we have a value of 0, there are no more digits. More...
 
struct  boost::mpl::end_impl< exercise_6_1::binary_tag >::apply
 
struct  boost::mpl::end_impl< exercise_6_1::binary_tag >::apply< exercise_6_1::binary< N > >
 
struct  exercise_6_1::binary< N >
 Compile-time binary to decimal number translation. More...
 
struct  exercise_6_1::binary< N >::apply_binary_digit< T1, T2 >
 Mathematics used by accumulate is broken out for clarity... More...
 
struct  exercise_6_1::binary< N >::apply_binary_digit< T1, binary< N2 > >
 Specialization so we can get direct access to the binary numebr. More...
 

Namespaces

namespace  exercise_6_1
 Encapsulate solution for Exercise 6-1.
 
namespace  boost
 Exists to inject functionality into the Boost namespace.
 
namespace  boost::mpl
 Exists to inject functionality into the Boost MPL namespace.
 

Detailed Description

Solution to Exercise 6-1.

Author
Matt Bisson

Definition in file exercise-6-1.hpp.