C++ Template Metaprogramming
Solutions to the exercises throughout the book
|
Augment the chapter5::tree sequence API to allow addition of elements. More...
#include "chapter-5-tree.hpp"
#include <boost/static_assert.hpp>
#include <boost/mpl/greater.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/push_back.hpp>
#include <boost/type_traits/is_same.hpp>
Go to the source code of this file.
Classes | |
struct | boost::mpl::push_back_impl< chapter5::tree_tag > |
Alter a tree structure by adding an element with sorted placement. More... | |
struct | boost::mpl::push_back_impl< chapter5::tree_tag >::apply |
The basic implementation makes a tree, assuming that the existing sequence (S) is a leaf node. More... | |
struct | boost::mpl::push_back_impl< chapter5::tree_tag >::apply< chapter5::tree< Cur, L, R >, New > |
Assuming that we're operating on a (sub)tree, recreate new trees with the added element. More... | |
struct | boost::mpl::push_back_impl< chapter5::tree_tag >::apply< chapter5::tree<>, New > |
Initial case. More... | |
struct | boost::mpl::push_back_impl< chapter5::tree_tag >::apply< void_, New > |
An "extra" step that terminates recursion if we're simply adding to a (sub)tree's open space. More... | |
Namespaces | |
namespace | boost |
Exists to inject functionality into the Boost namespace. | |
namespace | boost::mpl |
Exists to inject functionality into the Boost MPL namespace. | |
Typedefs | |
typedef chapter5::tree | t1 |
typedef boost::mpl::push_back< t1, boost::mpl::int_< 5 > >::type | t2 |
typedef boost::mpl::push_back< t2, boost::mpl::int_< 3 > >::type | t3 |
typedef boost::mpl::push_back< t3, boost::mpl::int_< 7 > >::type | t4 |
typedef boost::mpl::push_back< t4, boost::mpl::int_< 1 > >::type | t5 |
typedef chapter5::tree< boost::mpl::int_< 5 >, chapter5::tree< boost::mpl::int_< 3 >, boost::mpl::int_< 1 >, void_ >, boost::mpl::int_< 7 > > | expected_t5 |
Functions | |
BOOST_STATIC_ASSERT ((boost::is_same< t5, expected_t5 >::value)) | |
Augment the chapter5::tree sequence API to allow addition of elements.
Definition in file chapter-6-tree.hpp.
typedef chapter5::tree< boost::mpl::int_<5>, chapter5::tree<boost::mpl::int_<3>, boost::mpl::int_<1>, void_>, boost::mpl::int_<7>> expected_t5 |
Definition at line 99 of file chapter-6-tree.hpp.
typedef chapter5::tree t1 |
Definition at line 89 of file chapter-6-tree.hpp.
Definition at line 90 of file chapter-6-tree.hpp.
Definition at line 91 of file chapter-6-tree.hpp.
Definition at line 92 of file chapter-6-tree.hpp.
Definition at line 93 of file chapter-6-tree.hpp.
BOOST_STATIC_ASSERT | ( | (boost::is_same< t5, expected_t5 >::value) | ) |