Compare commits

..

1 Commits

Author SHA1 Message Date
nobody
89401faa97 This commit was manufactured by cvs2svn to create tag
'Version_1_18_0'.

[SVN r7873]
2000-09-29 11:39:43 +00:00
2 changed files with 7 additions and 27 deletions

View File

@@ -34,14 +34,13 @@ namespace boost {
struct counting_iterator_policies : public default_iterator_policies
{
template <class IntegerType>
const IntegerType&
dereference(type<const IntegerType&>, const IntegerType& i) const
IntegerType dereference(type<IntegerType>, const IntegerType& i) const
{ return i; }
};
template <class IntegerType>
struct counting_iterator_traits {
typedef IntegerType value_type;
typedef const IntegerType& reference;
typedef IntegerType reference;
typedef value_type* pointer;
typedef std::ptrdiff_t difference_type;
typedef std::random_access_iterator_tag iterator_category;
@@ -81,13 +80,6 @@ protected:
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
#ifdef BOOST_USE_ITERATOR_ADAPTORS

View File

@@ -37,11 +37,8 @@ struct type {};
// class if you want to customize particular policies.
struct default_iterator_policies
{
// Some of these members were defined static, but Borland got confused
// and thought they were non-const.
template <class Reference, class Iterator>
Reference dereference(type<Reference>, const Iterator& x) const
static Reference dereference(type<Reference>, const Iterator& x)
{ return *x; }
template <class Iterator>
@@ -57,15 +54,15 @@ struct default_iterator_policies
{ x += n; }
template <class Difference, class Iterator1, class Iterator2>
Difference distance(type<Difference>, const Iterator1& x, const Iterator2& y) const
static Difference distance(type<Difference>, const Iterator1& x, const Iterator2& y)
{ return y - x; }
template <class Iterator1, class Iterator2>
bool equal(const Iterator1& x, const Iterator2& y) const
static bool equal(const Iterator1& x, const Iterator2& y)
{ return x == y; }
template <class Iterator1, class Iterator2>
bool less(const Iterator1& x, const Iterator2& y) const
static bool less(const Iterator1& x, const Iterator2& y)
{ return x < y; }
};
@@ -174,11 +171,10 @@ public:
typedef typename Traits::pointer pointer;
typedef typename Traits::reference reference;
typedef typename Traits::iterator_category iterator_category;
typedef Iterator iterator_type;
iterator_adaptor() { }
iterator_adaptor(const iterator_type& iter, const Policies& p = Policies())
iterator_adaptor(const Iterator& iter, const Policies& p = Policies())
: m_iter_p(iter, p) {}
#ifdef BOOST_MSVC6_MEMBER_TEMPLATES
@@ -227,13 +223,7 @@ public:
{ return *(*this + n); }
Self& operator++() {
#ifdef __MWERKS__
// Odd bug, MWERKS couldn't deduce the type for the member template
// Workaround by explicitly specifying the type.
policies().increment<Iterator>(iter());
#else
policies().increment(iter());
#endif
return *this;
}
@@ -256,8 +246,6 @@ public:
return *this;
}
iterator_type base() const { return m_iter_p.first(); }
private:
typedef Policies policies_type;
compressed_pair<Iterator,Policies> m_iter_p;