C++ Template Metaprogramming
Solutions to the exercises throughout the book
Loading...
Searching...
No Matches
Class Hierarchy
This inheritance list is sorted roughly, but not completely, alphabetically:
[detail level 123]
 Cexercise_2_0::with_boost::add_const_ref< T >Boost MPL implementation
 Cexercise_2_0::no_boost::add_const_ref_impl< T, IsRef >The default implementation adds a const& to the template type
 Cexercise_2_0::no_boost::add_const_ref_impl< T &, true >
 Cexercise_2_0::no_boost::add_const_ref_impl< T, false >
 Cexercise_2_0::no_boost::add_const_ref_impl< T, true >Simply return the original type if we're already a reference type
 Cboost::mpl::advance< chapter5::tiny_iterator< Tiny, Pos >, N >Iterator advance is simple numerical addition
 Cboost::mpl::advance< chapter7::zip_iterator< IteratorSeq, random_access_iterator_tag >, N >Creates a sequence from the result of boost::mpl::advance
 Cboost::mpl::and_
 Cboost::mpl::apply
 Cboost::mpl::at_impl< chapter7::zip_view_tag >::apply
 Cboost::mpl::begin_impl< chapter5::tiny_tag >::apply
 Cboost::mpl::begin_impl< chapter7::permutation_view_tag >::apply
 Cboost::mpl::begin_impl< exercise_5_6::dimensions_tag >::apply
 Cboost::mpl::begin_impl< exercise_5_7::dimensions_b_tag >::apply
 Cboost::mpl::begin_impl< exercise_5_8::fibonacci_series_tag >::apply
 Cboost::mpl::begin_impl< exercise_6_1::binary_tag >::apply
 Cboost::mpl::end_impl< chapter5::tiny_tag >::apply
 Cboost::mpl::end_impl< exercise_5_6::dimensions_tag >::apply
 Cboost::mpl::end_impl< exercise_5_7::dimensions_b_tag >::apply
 Cboost::mpl::end_impl< exercise_6_1::binary_tag >::apply
 Cboost::mpl::erase_impl< chapter5::tiny_tag >::apply
 Cboost::mpl::insert_impl< chapter5::tiny_tag >::apply
 Cboost::mpl::pop_back_impl< exercise_5_7::dimensions_b_tag >::apply
 Cboost::mpl::push_back_impl< chapter5::tree_tag >::apply< chapter5::tree<>, New >Initial case
 Cboost::mpl::pop_back_impl< exercise_5_7::dimensions_b_tag >::apply< exercise_5_7::dimensions_b< T[N]> >
 Cboost::mpl::begin_impl< exercise_6_1::binary_tag >::apply< exercise_6_1::binary< N > >
 Cboost::mpl::end_impl< exercise_6_1::binary_tag >::apply< exercise_6_1::binary< N > >
 Cboost::mpl::erase_impl< chapter5::tiny_tag >::apply< S, First, boost::mpl::next< First >::type >
 Cboost::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
 Cexercise_6_1::binary< N >::apply_binary_digit< T1, T2 >Mathematics used by accumulate is broken out for clarity..
 Cexercise_6_1::binary< N >::apply_binary_digit< T1, binary< N2 > >Specialization so we can get direct access to the binary numebr
 Cboost::mpl::at_impl< chapter7::zip_view_tag >::apply_impl
 Cboost::mpl::at_impl< chapter7::zip_view_tag >::apply_impl< S, chapter7::least_refined_iterator_category< S >::type, N >
 Cboost::mpl::at_impl< chapter7::zip_view_tag >::apply_impl< S, random_access_iterator_tag, N >
 Cboost::mpl::push_back_impl< exercise_5_7::dimensions_b_tag >::apply_num
 Cboost::mpl::push_back_impl< exercise_5_7::dimensions_b_tag >::apply_num< exercise_5_7::dimensions_b< T >, N >
 Cboost::mpl::push_back_impl< exercise_5_7::dimensions_b_tag >::apply_num< S, Elem::value >
 Cboost::mpl::begin_impl< exercise_5_10::inorder_view_tag >::apply_on_iterator< L, exercise_5_10::inorder_view_iterator< chapter5::tree< Cur, L, R >, Parent, 1 > >
 Cboost::mpl::begin_impl< exercise_5_10::inorder_view_tag >::apply_on_iterator< S::tree_root, exercise_5_10::inorder_view_iterator_end >
 Cat
 Cboost::mpl::at_impl< chapter5::tiny_tag >Forward to tiny_at for O(1) access
 Cboost::mpl::at_impl< chapter7::zip_view_tag >Create a sequence from the result of boost::mpl::at
 Cboost::mpl::begin_impl< chapter5::tiny_tag >Initialize the iterator with a position of 0
 Cboost::mpl::begin_impl< chapter7::permutation_view_tag >Load an iterator with the beginning to both sequences
 Cboost::mpl::begin_impl< exercise_5_10::inorder_view_tag >The begin algorithm needs to traverse to the leftmost element, creating iterators along the way
 Cboost::mpl::begin_impl< exercise_5_6::dimensions_tag >Just wrap the sequence in an iterator
 Cboost::mpl::begin_impl< exercise_5_7::dimensions_b_tag >Wrap an iterator around the front of the sequence
 Cboost::mpl::begin_impl< exercise_5_8::fibonacci_series_tag >Start with 1 in the "last" position so we don't waste time with 0+0
 Cboost::mpl::begin_impl< exercise_6_1::binary_tag >Simply return the binary type as is
 Cexercise_5_7::begin_impl_traversal< S, S_Prev >Begin_impl_traversal walks the list to find the beginning
 Cexercise_5_7::begin_impl_traversal< S, boost::mpl::void_ >We've found the beginning
 Cchapter1::binary< N >Prepend higher bits to lowest bit
 Cexercise_6_1::binary< N >Compile-time binary to decimal number translation
 Cchapter1::binary< 0 >Recursion termination
 Cexercise_6_1::binary_tagA tag for tag-dispatched sequence metafunctions
 Cexercise_6_3::binary_tree_inserter< S, Op >Basically indistinguishable from from any other inserter since we have a generic insert metafunction
 Cexercise_3_0::checked_binary< N >Compile-time binary to decimal number translation
 Cexercise_3_0::checked_binary< 0 >Recursion termination
 Cboost::mpl::clear_impl< chapter5::tiny_tag >Simply return a new, empty tiny sequence
 Cboost::mpl::copy
 Cderef
 Cboost::mpl::deref< exercise_5_10::inorder_view_iterator< chapter5::tree< Cur, L, R >, Parent, VisitCount > >Grab the first value from the subtree contained in the iterator
 Cboost::mpl::deref< exercise_5_10::inorder_view_iterator< Cur, Parent, VisitCount > >This specialization is only for leaf nodes. Grab it directly from the iterator
 Cboost::mpl::deref< exercise_5_6::dimensions_iterator< S > >The iterator just contains a subset of the underlying sequence
 Cboost::mpl::deref< exercise_6_1::binary< N > >Algorithms require the full binary type for computations
 Cexercise_5_6::dimensions< T[N]>Basically a tuple where the "head" is the value, and the rest is accessed by "tail"
 Cexercise_5_7::dimensions_b_iterator< S >Define a bi-directional iterator for our dimensions_b sequence
 Cexercise_5_7::dimensions_b_tagA tag for tag-dispatched sequence metafunctions
 Cexercise_5_6::dimensions_iterator< S >Define a (forward-only) iterator for our dimensions sequence
 Cexercise_5_6::dimensions_tagA tag for tag-dispatched sequence metafunctions
 Cexercise_5_1::double_first_half_impl< S, Res, Cur >Represents a single iteration across the sequence
 Cexercise_5_1::double_first_half_impl< S, boost::mpl::vector_c< int >, boost::mpl::begin< S >::type >
 Cboost::mpl::end
 Cboost::mpl::end_impl< chapter5::tiny_tag >Finding the end requires tiny_size, which is O(1) complexity
 Cboost::mpl::end_impl< chapter5::tree_tag >Pass along our special "end" type
 Cboost::mpl::end_impl< chapter7::permutation_view_tag >An iterator with the end of the indices sequence and the beginning of the other
 Cboost::mpl::end_impl< exercise_5_10::inorder_view_tag >Simply returns inorder_view_iterator_end
 Cboost::mpl::end_impl< exercise_5_6::dimensions_tag >The end is a boost::mpl::void_ type
 Cboost::mpl::end_impl< exercise_5_7::dimensions_b_tag >Wrap an iterator around boost::mpl::void_
 Cboost::mpl::end_impl< exercise_6_1::binary_tag >When we have a value of 0, there are no more digits
 Cboost::mpl::erase_impl< chapter5::tiny_tag >Use our tiny_erase to form the new sequence in O(1) time
 Cboost::mpl::eval_if
 Cexercise_3_1::ex_3_1applyMetafunction to apply during transformation
 Cchapter7::extract_iterator_category< S >A simple metafunction to get the iterator category from the first iterator in a sequence
 Cexercise_5_8::fibonacci_seriesThe Fibonacci series for use with Boost MPL sequences
 Cexercise_5_8::fibonacci_series_iterator< N, LastN >Iterator for moving through Fibonacci series sequence
 Cexercise_5_8::fibonacci_series_tagA tag for tag-dispatched sequence metafunctions
 Cexercise_6_0::find_smaller< no_type, T2 >Specialize the initial case
 Cboost::mpl::if_< boost::mpl::bool_, T1, T2 >
 Cexercise_5_10::inorder_view< T >Compels iterators to traverse the tree "in order"
 Cexercise_5_10::inorder_view_iterator< Cur, Parent, VisitCount >Establish an iterator to contain in-order traversal of the binary tree
 Cexercise_5_10::inorder_view_iterator< chapter5::tree< Cur, L, R >, Parent, 2 >
 Cexercise_5_10::inorder_view_iterator< Cur, Parent, 1 >
 Cexercise_5_10::inorder_view_iterator< Self, Parent, 1 >
 Cexercise_5_10::inorder_view_tagA tag for tag-dispatched sequence metafunctions
 Cboost::mpl::insert_impl< chapter5::tiny_tag >Using tiny_insert is O(1) time
 Cboost::mpl::int_
 Cboost::mpl::iterator_range
 Cboost::mpl::joint_view
 Cchapter7::least_refined_iterator_category< S >Assuming a sequence of sequences, find the least refined category of all subsequences
 Cexercise_4_1::logical_and< E1, E2 >Short-circuit logical OR evaluation of two boolean values
 Cexercise_4_1::logical_and< boost::mpl::false_, E2 >Short-circuit on a true value
 Cexercise_4_1::logical_and< boost::mpl::true_, E2 >If the first value is true, the result is whatever E2's value is
 Cexercise_4_1::logical_or< E1, E2 >Short-circuit logical OR evaluation of two boolean values
 Cexercise_4_2::logical_or5< E1, E2, E3, E4, E5 >Short-circuit logical OR evaluation for up to five boolean values
 Cexercise_4_2::logical_or5< boost::mpl::bool_< E2::value >, E2, E3, E4, boost::mpl::false_ >
 Cexercise_4_2::logical_or5< boost::mpl::false_, boost::mpl::false_, boost::mpl::false_, boost::mpl::false_, E5 >If everything is a simple boost::mpl::false_ we can end recursion
 Cexercise_4_2::logical_or5< boost::mpl::true_, E2, E3, E4, E5 >Short-circuit on a true value
 Cexercise_4_1::logical_or< boost::mpl::false_, E2 >If the first value is false, the result is whatever E2's value is
 Cexercise_4_1::logical_or< boost::mpl::true_, E2 >Short-circuit on a true value
 Cboost::mpl::minus
 Cnext
 Cboost::mpl::next< chapter5::tiny_iterator< Tiny, Pos > >Iterator next simply increments our numerical position info
 Cboost::mpl::next< chapter7::zip_iterator< IteratorSeq, Category > >Creates a sequence of the next element for each (sub-)iterator
 Cboost::mpl::next< exercise_5_10::inorder_view_iterator< chapter5::tree< Cur, L, R >, Parent, VisitCount > >This is an error – Visit count must not be [0,3]
 Cboost::mpl::next< exercise_5_6::dimensions_iterator< S > >The sequence itself defines "next"
 Cboost::mpl::next< exercise_5_7::dimensions_b_iterator< S > >Next is defined by the sequence
 Cboost::mpl::next< exercise_5_8::fibonacci_series_iterator< 1134903170, 701408733 > >Establish an end (based on 32-bit signed int size)
 Cboost::mpl::next< exercise_5_8::fibonacci_series_iterator< N, LastN > >Make the new N the sum of both numbers; save the old N
 Cboost::mpl::next< exercise_6_1::binary< N > >Strip the least-significant binary digit from the number
 Cexercise_6_0::no_typeProvide a type to return if the sequence is empty (no "small" type)
 Cchapter5::noneQuickly define a NULL type
 Cboost::mpl::or_
 Cchapter7::permutation_iterator< CurIdxIter, SeqBegin >Iterates across a seqence in an order defined by another sequence
 Cchapter7::permutation_iterator< begin< Indices >::type, begin< Sequence >::type >
 Cchapter7::permutation_iterator< end< Sequence::indices >::type, begin< Sequence::orig_sequence >::type >
 Cchapter7::permutation_iterator< next< CurIdxIter >::type, SeqBegin >
 Cchapter7::permutation_iterator< prior< CurIdxIter >::type, SeqBegin >
 Cchapter7::permutation_view< Indices, Sequence >Alter the order sequence traversal using a sequence of positions
 Cchapter7::permutation_view_tagType for tag-based implementation of algorithms below
 Cboost::mpl::plus
 Cboost::mpl::pop_back_impl< chapter5::tiny_tag >This forwards operation to the erase metafunction
 Cboost::mpl::pop_back_impl< exercise_5_7::dimensions_b_tag >Popping from the back just means drop one array dimension
 Cboost::mpl::pop_front_impl< chapter5::tiny_tag >This forwards operation to the erase metafunction
 Cboost::mpl::prior< chapter5::tiny_iterator< Tiny, Pos > >Iterator prior simply decrements our numerical position info
 Cboost::mpl::prior< chapter7::zip_iterator< IteratorSeq, Category > >Specialize prior, but only for bidirection or better iterator types
 Cboost::mpl::prior< exercise_5_7::dimensions_b_iterator< S > >Prev is defined by the sequence
 Cboost::mpl::prior< exercise_5_8::fibonacci_series_iterator< 0, 1 > >Don't go before 0..
 Cboost::mpl::prior< exercise_5_8::fibonacci_series_iterator< 1, 1 > >Special case because we chose an irregular "begin" iterator value
 Cboost::mpl::prior< exercise_5_8::fibonacci_series_iterator< N, LastN > >Backward iteration is computable easily
 Cboost::mpl::push_back_impl< chapter5::tiny_tag >If we can insert, use that, otherwise, use tiny_push_back
 Cboost::mpl::push_back_impl< chapter5::tree_tag >Alter a tree structure by adding an element with sorted placement
 Cboost::mpl::push_back_impl< exercise_5_7::dimensions_b_tag >Just convert the input to an integer, and add to the array dimension
 Cboost::mpl::push_front_impl< chapter5::tiny_tag >Front insertion is straightforward. Assert we're not already full
 Cexercise_3_5::section_3_1::quantity< T, Dimension >A numerical quanitity with intrinsic dimensions
 Cboost::mpl::rbegin< Sequence >Grab a reverse_iterator from the a sequence directly
 Cboost::mpl::rend< Sequence >Acquire a reverse_iterator at the end of a sequence
 Cexercise_2_1::cpp20::replace_type< C, X, Y >Given an arbitrary compound type, replace nested types
 Cexercise_2_1::replace_type< C, X, Y >Given an arbitrary compound type, replace nested types
 Cexercise_2_1::cpp20::replace_type< C &, X, Y >Descend through reference types
 Cexercise_2_1::replace_type< C &, X, Y >Descend through reference types
 Cexercise_2_1::cpp20::replace_type< C *, X, Y >Descend through pointer types
 Cexercise_2_1::replace_type< C *, X, Y >Descend through pointer types
 Cexercise_2_1::cpp20::replace_type< C[N], X, Y >Descend through array types
 Cexercise_2_1::replace_type< C[N], X, Y >Descend through array types
 Cexercise_2_1::replace_type< Cr(*)(), X, Y >Descent through nullary function types
 Cexercise_2_1::replace_type< Cr(*)(C0), X, Y >Descent through unary function types
 Cexercise_2_1::replace_type< Cr(*)(C0, C1), X, Y >Descent through binary function types
 Cexercise_2_1::cpp20::replace_type< Cr(*)(CArgs...), X, Y >Decend through all aspects of pointers to functions
 Cexercise_2_1::replace_type< Cr(*)(CArgs...), X, Y >Decend through all aspects of pointers to functions
 Cexercise_2_1::cpp20::replace_type_dispatch< C, X, Y, Same >Internal type used by replace_type
 Cexercise_2_1::replace_type_dispatch< C, X, Y, Same >Internal type used by replace_type
 Cexercise_2_1::cpp20::replace_type_dispatch< C, X, Y, false >Recurse into replace_type
 Cexercise_2_1::replace_type_dispatch< C, X, Y, false >Recurse into replace_type
 Cexercise_2_1::cpp20::replace_type_dispatch< C, X, Y, true >Replace leaf types
 Cexercise_2_1::replace_type_dispatch< C, X, Y, true >Replace leaf types
 Cexercise_6_0::replace_with_smaller< State, Operation >This is our "inserter." It really just replaces instead of inserting, though
 Cexercise_7_7::reverse_iterator< ForwardIt >Wraps any iterator with the intent of reversing the direction of next and prior
 Cexercise_7_7::reverse_iterator< next< ForwardIt >::type >
 Cexercise_7_7::reverse_iterator< prior< ForwardIt >::type >
 CS
 Cboost::mpl::size_impl< chapter5::tiny_tag >Forward the MPL size lambda over to tiny_size
 Cerase_impl::template apply
 Ctest_4_4::test_class
 Canonymous_namespace{chapter-1.cpp}::test_resultContainer for test input and output
 Canonymous_namespace{chapter-2.cpp}::TestA
 Cchapter5::tiny< T0, T1, T2 >A small, random-access sequence type
 Cchapter5::tiny< S::t0 >
 Cchapter5::tiny< S::t0, S::t1 >
 Cchapter5::tiny< S::t0, S::t2 >
 Cchapter5::tiny< S::t1, S::t2 >
 Cchapter5::tiny< S::t2 >
 Cchapter5::tiny< T, none, none >
 Cchapter5::tiny< T, Tiny::t0, Tiny::t1 >
 Cchapter5::tiny< Tiny::t0, T, none >
 Cchapter5::tiny< Tiny::t0, T, Tiny::t1 >
 Cchapter5::tiny< Tiny::t0, Tiny::t1, T >
 Cchapter5::tiny_at< Tiny, Pos >Provide O(1) access to sequences tagged with tiny_tag
 Cchapter5::tiny_at< Tiny, 0 >
 Cchapter5::tiny_at< Tiny, 1 >
 Cchapter5::tiny_at< Tiny, 2 >
 Cchapter5::tiny_at< Tiny, N::value >
 Cchapter5::tiny_erase< S, First, Last >Erase a range of elements from a tiny sequence
 Cchapter5::tiny_erase< S, First::value, Last::value >
 Cchapter5::tiny_insert< Tiny, T, N >Insert into the tiny sequence
 Cchapter5::tiny_insert< Tiny, T, Pos::value >
 Cchapter5::tiny_insert< Tiny, T, size< Tiny >::value >
 Cchapter5::tiny_iterator< Tiny, Pos >Define an iterator for use with the tiny sequence type
 Cchapter5::tiny_push_back< Tiny, T, N >Add an element to the end of the tiny sequence
 Cchapter5::tiny_tagType for tag-based implementation of algorithms below
 Cboost::mpl::transform
 Cchapter5::tree< Cur, L, R >A basic type to represent a binary tree
 Cexercise_6_4::tree_endQuick and dirty (non-iterator, I know) way to mark the end of the tree sequence..
 Cchapter5::tree_tagUsed for Boost MPL's tag-based dispatch of sequence metafunctions
 Cexercise_3_6::twice_lambdaA lambda to perform a metafunction twice
 Cmpl::eval_if::type
 Cmpl::eval_if::type
 Cexercise_2_3::type_descriptor< T >
 Cexercise_2_4::cpp20::type_descriptor< T >Print (a limited set of) data-types
 Cexercise_2_4::type_descriptor< T >Print (a limited set of) data-types
 Cexercise_2_5::cpp20::type_descriptor_eng< T >Display data-types in English wording
 Cexercise_2_5::type_descriptor_eng< T >Display data-types in English wording
 Cchapter4::undefined_false< B >If the template parameter is false, template instantiation is an error
 Cchapter4::undefined_false< true >Define this metafunction if specialized to true
 Cchapter4::undefined_true< B >If the template parameter is true, template instantiation is an error
 Cchapter4::undefined_true< false >Define this metafunction if specialized to false
 Cboost::mpl::void_
 Cchapter7::zip_view_tagType for tag-based implementation of algorithms below