C++ Template Metaprogramming
Solutions to the exercises throughout the book
Loading...
Searching...
No Matches
chapter-5.cpp File Reference

Test application for Chapter 5. More...

#include "chapter-5-tiny.hpp"
#include "exercise-5-1.hpp"
#include "exercise-5-6.hpp"
#include "exercise-5-7.hpp"
#include "exercise-5-8.hpp"
#include "exercise-5-9.hpp"
#include "exercise-5-10.hpp"
#include <boost/mpl/vector.hpp>
#include <stdio.h>

Go to the source code of this file.

Namespaces

namespace  test_5_1
 Tests functionality from Exercise 5-1.
 
namespace  test_5_8
 Tests functionality from Exercise 5-8.
 
namespace  test_5_10
 Tests functionality from Exercise 5-10.
 
namespace  anonymous_namespace{chapter-5.cpp}
 

Macros

#define PARANOID_DEBUG_TEST
 

Typedefs

typedef boost::mpl::vector_c< int, 1, 2, 3, 4 > test_5_1::testVec
 
typedef double_first_half< testVec >::type test_5_1::testVec2
 
typedef boost::mpl::advance_c< boost::mpl::begin< exercise_5_8::fibonacci_series >::type, 6 >::type test_5_8::i
 
typedef boost::mpl::advance_c< i, 4 >::type test_5_8::j
 
typedef chapter5::tree< double, chapter5::tree< void *, int, long >, char > test_5_10::tree_seq
 A test tree.
 
typedef chapter5::tree< double, chapter5::tree< short, long, chapter5::tree< float, void * > >, chapter5::tree< int, void_, char > > test_5_10::tree_seq_hard
 A more involved test tree.
 
typedef boost::mpl::begin< inorder_view< tree_seq_hard > >::type test_5_10::tmp1
 
typedef boost::mpl::deref< tmp1 >::type test_5_10::tmp1d
 
typedef boost::mpl::next< tmp1 >::type test_5_10::tmp2
 
typedef boost::mpl::deref< tmp2 >::type test_5_10::tmp2d
 
typedef boost::mpl::next< tmp2 >::type test_5_10::tmp3
 
typedef boost::mpl::deref< tmp3 >::type test_5_10::tmp3d
 
typedef boost::mpl::next< tmp3 >::type test_5_10::tmp4
 
typedef boost::mpl::deref< tmp4 >::type test_5_10::tmp4d
 
typedef boost::mpl::next< tmp4 >::type test_5_10::tmp5
 
typedef boost::mpl::deref< tmp5 >::type test_5_10::tmp5d
 
typedef boost::mpl::next< tmp5 >::type test_5_10::tmp6
 
typedef boost::mpl::deref< tmp6 >::type test_5_10::tmp6d
 
typedef boost::mpl::next< tmp6 >::type test_5_10::tmp7
 
typedef boost::mpl::deref< tmp7 >::type test_5_10::tmp7d
 
typedef boost::mpl::next< tmp7 >::type test_5_10::tmp8
 
typedef boost::mpl::end< inorder_view< tree_seq_hard > >::type test_5_10::tmp_end
 

Functions

 test_5_1::BOOST_STATIC_ASSERT ((boost::mpl::equal< testVec2, boost::mpl::vector_c< int, 2, 4, 3, 4 > >::value))
 
 test_5_8::BOOST_STATIC_ASSERT (boost::mpl::deref< i >::type::value==8)
 
 test_5_8::BOOST_STATIC_ASSERT (boost::mpl::deref< j >::type::value==55)
 
 test_5_10::BOOST_STATIC_ASSERT ((boost::is_same< long, tmp1d >::value))
 
 test_5_10::BOOST_STATIC_ASSERT ((boost::is_same< short, tmp2d >::value))
 
 test_5_10::BOOST_STATIC_ASSERT ((boost::is_same< void *, tmp3d >::value))
 
 test_5_10::BOOST_STATIC_ASSERT ((boost::is_same< float, tmp4d >::value))
 
 test_5_10::BOOST_STATIC_ASSERT ((boost::is_same< double, tmp5d >::value))
 
 test_5_10::BOOST_STATIC_ASSERT ((boost::is_same< int, tmp6d >::value))
 
 test_5_10::BOOST_STATIC_ASSERT ((boost::is_same< char, tmp7d >::value))
 
 test_5_10::BOOST_STATIC_ASSERT ((boost::is_same< tmp_end, tmp8 >::value))
 
 test_5_10::BOOST_STATIC_ASSERT ((boost::mpl::equal< exercise_5_10::inorder_view< tree_seq >, boost::mpl::vector< int, void *, long, double, char >, boost::is_same< _1, _2 > >::value))
 
 test_5_10::BOOST_STATIC_ASSERT ((boost::mpl::equal< exercise_5_10::inorder_view< tree_seq_hard >, boost::mpl::vector< long, short, void *, float, double, int, char >, boost::is_same< _1, _2 > >::value))
 
static void anonymous_namespace{chapter-5.cpp}::test_exercise_5_0 ()
 Tests for Exercise 5-0.
 
static void anonymous_namespace{chapter-5.cpp}::test_exercise_5_3 ()
 Tests for Exercise 5-3.
 
static void anonymous_namespace{chapter-5.cpp}::test_exercise_5_5 ()
 Tests for Exercise 5-5.
 
static void anonymous_namespace{chapter-5.cpp}::test_exercise_5_6 ()
 Tests for Exercise 5-6.
 
static void anonymous_namespace{chapter-5.cpp}::test_exercise_5_7 ()
 Tests for Exercise 5-7.
 
static void anonymous_namespace{chapter-5.cpp}::print_fibonacci_series ()
 Give us a nice subroutine to tie Fibonacci seq printout all together.
 
int main ()
 

Detailed Description

Test application for Chapter 5.

Author
Matt Bisson

Definition in file chapter-5.cpp.

Macro Definition Documentation

◆ PARANOID_DEBUG_TEST

#define PARANOID_DEBUG_TEST

Definition at line 22 of file chapter-5.cpp.

Function Documentation

◆ main()

int main ( )

Definition at line 400 of file chapter-5.cpp.