10#ifndef CHAPTER_7_PERMUTATION_VIEW
11#define CHAPTER_7_PERMUTATION_VIEW
13#include <boost/mpl/advance.hpp>
14#include <boost/mpl/begin_end.hpp>
15#include <boost/mpl/deref.hpp>
16#include <boost/mpl/iterator_tags.hpp>
17#include <boost/mpl/iterator_category.hpp>
18#include <boost/mpl/next_prior.hpp>
39template <
typename CurIdxIter,
typename SeqBegin>
45 typedef typename boost::mpl::iterator_category<CurIdxIter>::type
category;
72template <
typename Indices,
typename Sequence>
92struct begin_impl<
chapter7::permutation_view_tag>
96 template <
typename Sequence>
struct apply { };
98 template <
typename Indices,
typename Sequence>
99 struct apply<
chapter7::permutation_view<Indices, Sequence> >
101 typename begin<Indices>::type, typename begin<Sequence>::type>
111 template <
typename Sequence>
114 typename end<typename Sequence::indices>::type,
115 typename begin<typename Sequence::orig_sequence>::type>
120template <
typename CurIdxIter,
typename SeqBegin>
121struct deref<
chapter7::permutation_iterator<CurIdxIter, SeqBegin> >
122 : deref<typename advance<SeqBegin, typename deref<CurIdxIter>::type>::type>
126template <
typename CurIdxIter,
typename SeqBegin>
127struct next<
chapter7::permutation_iterator<CurIdxIter, SeqBegin> >
132template <
typename CurIdxIter,
typename SeqBegin>
133struct prior<
chapter7::permutation_iterator<CurIdxIter, SeqBegin> >
Exists to inject functionality into the Boost MPL namespace.
Exists to inject functionality into the Boost namespace.
Provide utilities availble to all Chapter 7 solutions.
Iterates across a seqence in an order defined by another sequence.
permutation_iterator< CurIdxIter, SeqBegin > type
boost::mpl::iterator_category< CurIdxIter >::type category
CurIdxIter current_index_iter
Type for tag-based implementation of algorithms below.
Alter the order sequence traversal using a sequence of positions.