mirror of
https://github.com/boostorg/iterator.git
synced 2025-07-03 07:46:41 +02:00
Compare commits
7 Commits
svn-branch
...
boost-1.18
Author | SHA1 | Date | |
---|---|---|---|
89401faa97 | |||
b54236986d | |||
24c3beb791 | |||
50c9214b82 | |||
c583cf8730 | |||
61d2d43ea5 | |||
76efd2456c |
@ -13,10 +13,16 @@
|
||||
#ifndef BOOST_INTEGER_RANGE_HPP_
|
||||
#define BOOST_INTEGER_RANGE_HPP_
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#include <boost/pending/detail/int_iterator.hpp>
|
||||
#else
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if !defined(BOOST_MSVC) || defined(__SGI_STL_PORT)
|
||||
#define BOOST_USE_ITERATOR_ADAPTORS
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_USE_ITERATOR_ADAPTORS
|
||||
#include <boost/pending/iterator_adaptors.hpp>
|
||||
#else
|
||||
#include <boost/pending/detail/int_iterator.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
@ -24,6 +30,7 @@ namespace boost {
|
||||
//=============================================================================
|
||||
// Counting Iterator and Integer Range Class
|
||||
|
||||
#ifdef BOOST_USE_ITERATOR_ADAPTORS
|
||||
struct counting_iterator_policies : public default_iterator_policies
|
||||
{
|
||||
template <class IntegerType>
|
||||
@ -38,15 +45,17 @@ struct counting_iterator_traits {
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef std::random_access_iterator_tag iterator_category;
|
||||
};
|
||||
#endif
|
||||
|
||||
template <class IntegerType>
|
||||
struct integer_range {
|
||||
#ifdef BOOST_MSVC
|
||||
typedef int_iterator<IntegerType> iterator;
|
||||
#else
|
||||
#ifdef BOOST_USE_ITERATOR_ADAPTORS
|
||||
typedef iterator_adaptor<IntegerType, counting_iterator_policies,
|
||||
counting_iterator_traits<IntegerType>, IntegerType> iterator;
|
||||
#else
|
||||
typedef int_iterator<IntegerType> iterator;
|
||||
#endif
|
||||
|
||||
typedef iterator const_iterator;
|
||||
typedef IntegerType value_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
@ -73,4 +82,8 @@ protected:
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#ifdef BOOST_USE_ITERATOR_ADAPTORS
|
||||
#undef BOOST_USE_ITERATOR_ADAPTORS
|
||||
#endif
|
||||
|
||||
#endif // BOOST_INTEGER_RANGE_HPP_
|
||||
|
@ -475,7 +475,7 @@ struct reverse_iterator_policies
|
||||
|
||||
template <class Difference, class Iterator1, class Iterator2>
|
||||
Difference distance(type<Difference>, const Iterator1& x,
|
||||
const Iterator2& y) const
|
||||
const Iterator2& y) const
|
||||
{ return x - y; }
|
||||
|
||||
template <class Iterator1, class Iterator2>
|
||||
|
Reference in New Issue
Block a user