forked from boostorg/iterator
changed reference type
[SVN r8033]
This commit is contained in:
@ -34,13 +34,14 @@ namespace boost {
|
|||||||
struct counting_iterator_policies : public default_iterator_policies
|
struct counting_iterator_policies : public default_iterator_policies
|
||||||
{
|
{
|
||||||
template <class IntegerType>
|
template <class IntegerType>
|
||||||
IntegerType dereference(type<IntegerType>, const IntegerType& i) const
|
const IntegerType&
|
||||||
|
dereference(type<const IntegerType&>, const IntegerType& i) const
|
||||||
{ return i; }
|
{ return i; }
|
||||||
};
|
};
|
||||||
template <class IntegerType>
|
template <class IntegerType>
|
||||||
struct counting_iterator_traits {
|
struct counting_iterator_traits {
|
||||||
typedef IntegerType value_type;
|
typedef IntegerType value_type;
|
||||||
typedef IntegerType reference;
|
typedef const IntegerType& reference;
|
||||||
typedef value_type* pointer;
|
typedef value_type* pointer;
|
||||||
typedef std::ptrdiff_t difference_type;
|
typedef std::ptrdiff_t difference_type;
|
||||||
typedef std::random_access_iterator_tag iterator_category;
|
typedef std::random_access_iterator_tag iterator_category;
|
||||||
@ -80,6 +81,13 @@ protected:
|
|||||||
IntegerType m_start, m_finish;
|
IntegerType m_start, m_finish;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <class IntegerType>
|
||||||
|
inline integer_range<IntegerType>
|
||||||
|
make_integer_range(IntegerType first, IntegerType last)
|
||||||
|
{
|
||||||
|
return integer_range<IntegerType>(first, last);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#ifdef BOOST_USE_ITERATOR_ADAPTORS
|
#ifdef BOOST_USE_ITERATOR_ADAPTORS
|
||||||
|
Reference in New Issue
Block a user