mirror of
https://github.com/boostorg/iterator.git
synced 2025-07-21 08:32:08 +02:00
uses proper template argument names : ElementIterator and IndexIterator
[SVN r11826]
This commit is contained in:
@ -9,12 +9,12 @@
|
|||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
|
|
||||||
template < typename OrderIt >
|
template < typename IndexIterator >
|
||||||
struct permutation_iterator_policies : public default_iterator_policies
|
struct permutation_iterator_policies : public default_iterator_policies
|
||||||
{
|
{
|
||||||
permutation_iterator_policies() {}
|
permutation_iterator_policies() {}
|
||||||
|
|
||||||
permutation_iterator_policies(OrderIt order_it)
|
permutation_iterator_policies(IndexIterator order_it)
|
||||||
: order_it_( order_it )
|
: order_it_( order_it )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -23,11 +23,11 @@ namespace boost {
|
|||||||
{ return *(x.base() + *order_it_); }
|
{ return *(x.base() + *order_it_); }
|
||||||
|
|
||||||
template <class IteratorAdaptor>
|
template <class IteratorAdaptor>
|
||||||
void increment(IteratorAdaptor& x)
|
void increment(IteratorAdaptor&)
|
||||||
{ ++order_it_; }
|
{ ++order_it_; }
|
||||||
|
|
||||||
template <class IteratorAdaptor>
|
template <class IteratorAdaptor>
|
||||||
void decrement(IteratorAdaptor& x)
|
void decrement(IteratorAdaptor&)
|
||||||
{ --order_it_; }
|
{ --order_it_; }
|
||||||
|
|
||||||
template <class IteratorAdaptor, class DifferenceType>
|
template <class IteratorAdaptor, class DifferenceType>
|
||||||
@ -43,28 +43,23 @@ namespace boost {
|
|||||||
bool equal(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
|
bool equal(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
|
||||||
{ return x.policies().order_it_ == y.policies().order_it_; }
|
{ return x.policies().order_it_ == y.policies().order_it_; }
|
||||||
|
|
||||||
OrderIt order_it_;
|
IndexIterator order_it_;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// generate an iterator that will access the elements
|
template < typename ElementIterator, typename IndexIterator >
|
||||||
/// behind the random-access iterator RAIt in the
|
|
||||||
/// order specified by the OrderIt iterator.
|
|
||||||
/// preconditions:
|
|
||||||
/// The OrderIt::value_type will be used in iterator arithmetic
|
|
||||||
template < typename RAIt, typename OrderIt >
|
|
||||||
struct permutation_iterator_generator
|
struct permutation_iterator_generator
|
||||||
{
|
{
|
||||||
typedef boost::iterator_adaptor
|
typedef boost::iterator_adaptor
|
||||||
< RAIt,
|
< ElementIterator,
|
||||||
permutation_iterator_policies< OrderIt >
|
permutation_iterator_policies< IndexIterator >
|
||||||
> type;
|
> type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template < class OrderIt, class RAIt >
|
template < class IndexIterator, class ElementIterator >
|
||||||
inline typename permutation_iterator_generator< RAIt, OrderIt >::type
|
inline typename permutation_iterator_generator< ElementIterator, IndexIterator >::type
|
||||||
make_permutation_iterator(RAIt base, OrderIt order)
|
make_permutation_iterator(ElementIterator base, IndexIterator order)
|
||||||
{
|
{
|
||||||
typedef typename permutation_iterator_generator< RAIt, OrderIt >::type result_t;
|
typedef typename permutation_iterator_generator< ElementIterator, IndexIterator >::type result_t;
|
||||||
return result_t( base, order );
|
return result_t( base, order );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user