C++ Template Metaprogramming
Solutions to the exercises throughout the book
Loading...
Searching...
No Matches
chapter-5-tree.hpp
Go to the documentation of this file.
1// ===-- chapter-5/chapter-5-tree.hpp --------------------- -*- C++ -*- --=== //
9#ifndef CHAPTER_5_10_TREE
10#define CHAPTER_5_10_TREE
11
12#include <boost/mpl/void.hpp>
13using boost::mpl::void_;
14
15
16namespace chapter5 {
17
19struct tree_tag { };
20
31template <typename Cur = void_, typename L = void_, typename R = void_>
32struct tree
33{
35 typedef tree_tag tag;
36};
37
38} // namespace chapter5
39
40#endif // CHAPTER_5_10_TREE
Provide utilities availble to all Chapter 5 solutions.
Used for Boost MPL's tag-based dispatch of sequence metafunctions.
A basic type to represent a binary tree.
tree< Cur, L, R > type