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

Define a tiny sequence with modifications from examples in Chapter 5. More...

#include <boost/static_assert.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/clear.hpp>
#include <boost/mpl/insert.hpp>
#include <boost/mpl/iterator_tags.hpp>
#include <boost/mpl/minus.hpp>
#include <boost/mpl/next_prior.hpp>
#include <boost/mpl/plus.hpp>
#include <boost/mpl/pop_back.hpp>
#include <boost/mpl/pop_front.hpp>
#include <boost/mpl/push_back.hpp>
#include <boost/mpl/push_front.hpp>
#include <boost/mpl/size.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/mpl/erase.hpp>

Go to the source code of this file.

Classes

struct  chapter5::none
 Quickly define a NULL type. More...
 
struct  chapter5::tiny_tag
 Type for tag-based implementation of algorithms below. More...
 
struct  chapter5::tiny_iterator< Tiny, Pos >
 Define an iterator for use with the tiny sequence type. More...
 
struct  chapter5::tiny< T0, T1, T2 >
 A small, random-access sequence type. More...
 
struct  chapter5::tiny_at< Tiny, Pos >
 Provide O(1) access to sequences tagged with tiny_tag. More...
 
struct  chapter5::tiny_at< Tiny, 0 >
 
struct  chapter5::tiny_at< Tiny, 1 >
 
struct  chapter5::tiny_at< Tiny, 2 >
 
struct  chapter5::tiny_push_back< Tiny, T, 0 >
 
struct  chapter5::tiny_push_back< Tiny, T, 1 >
 
struct  chapter5::tiny_push_back< Tiny, T, 2 >
 
struct  chapter5::tiny_insert< Tiny, T, 0 >
 
struct  chapter5::tiny_insert< Tiny, T, 1 >
 
struct  chapter5::tiny_insert< Tiny, T, 2 >
 
struct  chapter5::tiny_size< T0, T1, T2 >
 Used to improve end metafunction performance, etc. More...
 
struct  chapter5::tiny_size< T0, T1, none >
 
struct  chapter5::tiny_size< T0, none, none >
 
struct  chapter5::tiny_size< none, none, none >
 
struct  boost::mpl::next< chapter5::tiny_iterator< Tiny, Pos > >
 Iterator next simply increments our numerical position info. More...
 
struct  boost::mpl::prior< chapter5::tiny_iterator< Tiny, Pos > >
 Iterator prior simply decrements our numerical position info. More...
 
struct  boost::mpl::advance< chapter5::tiny_iterator< Tiny, Pos >, N >
 Iterator advance is simple numerical addition. More...
 
struct  boost::mpl::deref< chapter5::tiny_iterator< Tiny, Pos > >
 Dereferencing the iterator is the first time we actually examine tiny. More...
 
struct  boost::mpl::distance< chapter5::tiny_iterator< Tiny, Pos1 >, chapter5::tiny_iterator< Tiny, Pos2 > >
 Our iterators deal in integers, so simply subtract the two. More...
 
struct  boost::mpl::at_impl< chapter5::tiny_tag >
 Forward to tiny_at for O(1) access. More...
 
struct  boost::mpl::at_impl< chapter5::tiny_tag >::apply
 
struct  boost::mpl::begin_impl< chapter5::tiny_tag >
 Initialize the iterator with a position of 0. More...
 
struct  boost::mpl::begin_impl< chapter5::tiny_tag >::apply
 
struct  boost::mpl::end_impl< chapter5::tiny_tag >
 Finding the end requires tiny_size, which is O(1) complexity. More...
 
struct  boost::mpl::end_impl< chapter5::tiny_tag >::apply
 
struct  boost::mpl::size_impl< chapter5::tiny_tag >
 Forward the MPL size lambda over to tiny_size. More...
 
struct  boost::mpl::size_impl< chapter5::tiny_tag >::apply
 
struct  boost::mpl::clear_impl< chapter5::tiny_tag >
 Simply return a new, empty tiny sequence. More...
 
struct  boost::mpl::clear_impl< chapter5::tiny_tag >::apply
 
struct  boost::mpl::push_back_impl< chapter5::tiny_tag >
 If we can insert, use that, otherwise, use tiny_push_back. More...
 
struct  boost::mpl::push_back_impl< chapter5::tiny_tag >::apply
 
struct  boost::mpl::push_front_impl< chapter5::tiny_tag >
 Front insertion is straightforward. Assert we're not already full. More...
 
struct  boost::mpl::push_front_impl< chapter5::tiny_tag >::apply
 
struct  boost::mpl::insert_impl< chapter5::tiny_tag >
 Using tiny_insert is O(1) time. More...
 
struct  boost::mpl::insert_impl< chapter5::tiny_tag >::apply< Tiny, chapter5::tiny_iterator< Tiny, Pos >, T >
 
struct  chapter5::tiny_erase< S, First, Last >
 Erase a range of elements from a tiny sequence. More...
 
struct  chapter5::tiny_erase< S, 0, 1 >
 
struct  chapter5::tiny_erase< S, 0, 2 >
 
struct  chapter5::tiny_erase< S, 0, 3 >
 
struct  chapter5::tiny_erase< S, 1, 2 >
 
struct  chapter5::tiny_erase< S, 1, 3 >
 
struct  chapter5::tiny_erase< S, 2, 3 >
 
struct  boost::mpl::erase_impl< chapter5::tiny_tag >
 Use our tiny_erase to form the new sequence in O(1) time. More...
 
struct  boost::mpl::erase_impl< chapter5::tiny_tag >::apply
 
struct  boost::mpl::erase_impl< chapter5::tiny_tag >::apply< S, First, mpl_::na >
 
struct  boost::mpl::erase_impl< chapter5::tiny_tag >::apply< S, chapter5::tiny_iterator< S, First >, chapter5::tiny_iterator< S, Last > >
 
struct  boost::mpl::pop_back_impl< chapter5::tiny_tag >
 This forwards operation to the erase metafunction. More...
 
struct  boost::mpl::pop_back_impl< chapter5::tiny_tag >::apply
 
struct  boost::mpl::pop_front_impl< chapter5::tiny_tag >
 This forwards operation to the erase metafunction. More...
 
struct  boost::mpl::pop_front_impl< chapter5::tiny_tag >::apply
 

Namespaces

namespace  chapter5
 Provide utilities availble to all Chapter 5 solutions.
 
namespace  boost
 Exists to inject functionality into the Boost namespace.
 
namespace  boost::mpl
 Exists to inject functionality into the Boost MPL namespace.
 

Detailed Description

Define a tiny sequence with modifications from examples in Chapter 5.

Author
Matt Bisson

Definition in file chapter-5-tiny.hpp.