15#include <boost/mpl/end.hpp>
16#include <boost/mpl/equal_to.hpp>
17#include <boost/mpl/greater.hpp>
18#include <boost/mpl/if.hpp>
87template <
typename S,
typename Elem>
89 : boost::mpl::eval_if<
90 boost::mpl::equal_to<Elem, S>,
92 boost::mpl::end< chapter5::tree<> >
96template <
typename Elem>
98 : boost::mpl::end< chapter5::tree<> > { };
101template <
typename Cur,
typename L,
typename R,
typename Elem>
103 : boost::mpl::eval_if<
104 boost::mpl::equal_to<Elem, Cur>,
105 chapter5::tree<Cur, L, R>,
107 boost::mpl::greater<Elem, Cur>,
108 binary_tree_search<R, Elem>,
109 binary_tree_search<L, Elem> >
Define a binary tree structure for future exercises.
Solution to Exercise 6-3.
Exists to inject functionality into the Boost MPL namespace.
Exists to inject functionality into the Boost namespace.
Provide utilities availble to all Chapter 5 solutions.
Encapsulate solution for Exercise 6-4.
Perform a search on a binary tree structure.
Quick and dirty (non-iterator, I know) way to mark the end of the tree sequence...