summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/bits/stl_iterator.h
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/include/bits/stl_iterator.h')
-rw-r--r--libstdc++-v3/include/bits/stl_iterator.h614
1 files changed, 277 insertions, 337 deletions
diff --git a/libstdc++-v3/include/bits/stl_iterator.h b/libstdc++-v3/include/bits/stl_iterator.h
index 7127a21b5bd..a50b3536811 100644
--- a/libstdc++-v3/include/bits/stl_iterator.h
+++ b/libstdc++-v3/include/bits/stl_iterator.h
@@ -34,101 +34,98 @@
namespace std
{
// 24.4.1 Reverse iterators
- template<class _Iterator>
+ template<typename _Iterator>
class reverse_iterator
- : public iterator<iterator_traits<_Iterator>::iterator_category,
- iterator_traits<_Iterator>::value_type,
- iterator_traits<_Iterator>::difference_type,
- iterator_traits<_Iterator>::pointer,
- iterator_traits<_Iterator>::reference>
+ : public iterator<typename iterator_traits<_Iterator>::iterator_category,
+ typename iterator_traits<_Iterator>::value_type,
+ typename iterator_traits<_Iterator>::difference_type,
+ typename iterator_traits<_Iterator>::pointer,
+ typename iterator_traits<_Iterator>::reference>
{
protected:
- _Iterator current;
+ _Iterator _M_current;
public:
- typedef iterator_traits<_Iterator> __traits_type;
- typedef typename __traits_type::iterator_category iterator_category;
- typedef typename __traits_type::value_type value_type;
- typedef typename __traits_type::difference_type difference_type;
- typedef typename __traits_type::pointer pointer;
- typedef typename __traits_type::reference reference;
-
- typedef _Iterator iterator_type;
- typedef reverse_iterator<_Iterator> _Self;
+ typedef _Iterator iterator_type;
+ typedef typename iterator_traits<_Iterator>::difference_type
+ difference_type;
+ typedef typename iterator_traits<_Iterator>::reference reference;
+ typedef typename iterator_traits<_Iterator>::pointer pointer;
public:
reverse_iterator() {}
explicit
- reverse_iterator(iterator_type __x) : current(__x) {}
+ reverse_iterator(iterator_type __x) : _M_current(__x) {}
- reverse_iterator(const _Self& __x) : current(__x.current) {}
+ reverse_iterator(const reverse_iterator& __x)
+ : _M_current(__x._M_current) { }
- template <class _Iter>
+ template<typename _Iter>
reverse_iterator(const reverse_iterator<_Iter>& __x)
- : current(__x.base()) {}
+ : _M_current(__x.base()) {}
iterator_type
- base() const { return current; }
+ base() const { return _M_current; }
reference
operator*() const
{
- _Iterator __tmp = current;
+ _Iterator __tmp = _M_current;
return *--__tmp;
}
pointer
operator->() const { return &(operator*()); }
- _Self&
+ reverse_iterator&
operator++()
{
- --current;
+ --_M_current;
return *this;
}
- _Self
+ reverse_iterator
operator++(int)
{
- _Self __tmp = *this;
- --current;
+ reverse_iterator __tmp = *this;
+ --_M_current;
return __tmp;
}
- _Self&
+ reverse_iterator&
operator--()
{
- ++current;
+ ++_M_current;
return *this;
}
- _Self operator--(int)
+ reverse_iterator operator--(int)
{
- _Self __tmp = *this;
- ++current;
+ reverse_iterator __tmp = *this;
+ ++_M_current;
return __tmp;
}
- _Self
+ reverse_iterator
operator+(difference_type __n) const
- { return _Self(current - __n); }
+ { return reverse_iterator(_M_current - __n); }
- _Self&
+ reverse_iterator&
operator+=(difference_type __n)
{
- current -= __n;
+ _M_current -= __n;
return *this;
}
- _Self
+ reverse_iterator
operator-(difference_type __n) const
- { return _Self(current + __n); }
+ { return reverse_iterator(_M_current + __n); }
- _Self&
+ reverse_iterator&
operator-=(difference_type __n)
{
- current += __n;
+ _M_current += __n;
return *this;
}
@@ -136,56 +133,56 @@ namespace std
operator[](difference_type __n) const { return *(*this + __n); }
};
- template<class _Iterator>
+ template<typename _Iterator>
inline bool
operator==(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return __x.base() == __y.base(); }
- template <class _Iterator>
+ template<typename _Iterator>
inline bool
operator<(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return __y.base() < __x.base(); }
- template <class _Iterator>
+ template<typename _Iterator>
inline bool
operator!=(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return !(__x == __y); }
- template <class _Iterator>
+ template<typename _Iterator>
inline bool
operator>(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return __y < __x; }
- template <class _Iterator>
+ template<typename _Iterator>
inline bool
operator<=(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return !(__y < __x); }
- template <class _Iterator>
+ template<typename _Iterator>
inline bool
operator>=(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return !(__x < __y); }
- template<class _Iterator>
+ template<typename _Iterator>
inline typename reverse_iterator<_Iterator>::difference_type
operator-(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return __y.base() - __x.base(); }
- template <class _Iterator>
+ template<typename _Iterator>
inline reverse_iterator<_Iterator>
operator+(typename reverse_iterator<_Iterator>::difference_type __n,
const reverse_iterator<_Iterator>& __x)
{ return reverse_iterator<_Iterator>(__x.base() - __n); }
// 24.4.2.2.1 back_insert_iterator
- template <class _Container>
+ template<typename _Container>
class back_insert_iterator
: public iterator<output_iterator_tag, void, void, void, void>
{
@@ -215,12 +212,12 @@ namespace std
operator++(int) { return *this; }
};
- template <class _Container>
+ template<typename _Container>
inline back_insert_iterator<_Container>
back_inserter(_Container& __x)
{ return back_insert_iterator<_Container>(__x); }
- template <class _Container>
+ template<typename _Container>
class front_insert_iterator
: public iterator<output_iterator_tag, void, void, void, void>
{
@@ -241,12 +238,11 @@ namespace std
front_insert_iterator<_Container>& operator++(int) { return *this; }
};
- template <class _Container>
- inline front_insert_iterator<_Container> front_inserter(_Container& __x) {
- return front_insert_iterator<_Container>(__x);
- }
+ template<typename _Container>
+ inline front_insert_iterator<_Container> front_inserter(_Container& __x)
+ { return front_insert_iterator<_Container>(__x); }
- template <class _Container>
+ template<typename _Container>
class insert_iterator
: public iterator<output_iterator_tag, void, void, void, void>
{
@@ -271,304 +267,248 @@ namespace std
insert_iterator<_Container>& operator++(int) { return *this; }
};
- template <class _Container, class _Iterator>
- inline
- insert_iterator<_Container> inserter(_Container& __x, _Iterator __i)
- {
- typedef typename _Container::iterator __iter;
- return insert_iterator<_Container>(__x, __iter(__i));
- }
+ template<typename _Container, typename _Iterator>
+ inline
+ insert_iterator<_Container> inserter(_Container& __x, _Iterator __i)
+ {
+ typedef typename _Container::iterator __iter;
+ return insert_iterator<_Container>(__x, __iter(__i));
+ }
- template <class _BidirectionalIterator, class _Tp, class _Reference = _Tp&,
- class _Distance = ptrdiff_t>
- class reverse_bidirectional_iterator {
- typedef reverse_bidirectional_iterator<_BidirectionalIterator, _Tp,
- _Reference, _Distance> _Self;
- protected:
- _BidirectionalIterator current;
- public:
- typedef bidirectional_iterator_tag iterator_category;
- typedef _Tp value_type;
- typedef _Distance difference_type;
- typedef _Tp* pointer;
- typedef _Reference reference;
-
- reverse_bidirectional_iterator() {}
- explicit reverse_bidirectional_iterator(_BidirectionalIterator __x)
- : current(__x) {}
- _BidirectionalIterator base() const { return current; }
- _Reference operator*() const {
- _BidirectionalIterator __tmp = current;
- return *--__tmp;
- }
- pointer operator->() const { return &(operator*()); }
- _Self& operator++() {
- --current;
- return *this;
- }
- _Self operator++(int) {
- _Self __tmp = *this;
- --current;
- return __tmp;
- }
- _Self& operator--() {
- ++current;
- return *this;
- }
- _Self operator--(int) {
- _Self __tmp = *this;
- ++current;
- return __tmp;
- }
-};
-
-template <class _BiIter, class _Tp, class _Ref, class _Distance>
-inline bool operator==(
- const reverse_bidirectional_iterator<_BiIter, _Tp, _Ref, _Distance>& __x,
- const reverse_bidirectional_iterator<_BiIter, _Tp, _Ref, _Distance>& __y)
-{
- return __x.base() == __y.base();
-}
-template <class _BiIter, class _Tp, class _Ref, class _Distance>
-inline bool operator!=(
- const reverse_bidirectional_iterator<_BiIter, _Tp, _Ref, _Distance>& __x,
- const reverse_bidirectional_iterator<_BiIter, _Tp, _Ref, _Distance>& __y)
-{
- return !(__x == __y);
-}
-
-
-
-template <class _Tp,
- class _CharT = char, class _Traits = char_traits<_CharT>,
- class _Dist = ptrdiff_t>
-class istream_iterator {
-public:
- typedef _CharT char_type;
- typedef _Traits traits_type;
- typedef basic_istream<_CharT, _Traits> istream_type;
-
- typedef input_iterator_tag iterator_category;
- typedef _Tp value_type;
- typedef _Dist difference_type;
- typedef const _Tp* pointer;
- typedef const _Tp& reference;
-
- istream_iterator() : _M_stream(0), _M_ok(false) {}
- istream_iterator(istream_type& __s) : _M_stream(&__s) { _M_read(); }
-
- reference operator*() const { return _M_value; }
- pointer operator->() const { return &(operator*()); }
-
- istream_iterator& operator++() {
- _M_read();
- return *this;
- }
- istream_iterator operator++(int) {
- istream_iterator __tmp = *this;
- _M_read();
- return __tmp;
- }
-
- bool _M_equal(const istream_iterator& __x) const
- { return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream); }
-
-private:
- istream_type* _M_stream;
- _Tp _M_value;
- bool _M_ok;
-
- void _M_read() {
- _M_ok = (_M_stream && *_M_stream) ? true : false;
- if (_M_ok) {
- *_M_stream >> _M_value;
- _M_ok = *_M_stream ? true : false;
- }
- }
-};
-
-template <class _Tp, class _CharT, class _Traits, class _Dist>
-inline bool
-operator==(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
- const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y) {
- return __x._M_equal(__y);
-}
-
-template <class _Tp, class _CharT, class _Traits, class _Dist>
-inline bool
-operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
- const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y) {
- return !__x._M_equal(__y);
-}
-
-
-template <class _Tp,
- class _CharT = char, class _Traits = char_traits<_CharT> >
-class ostream_iterator {
-public:
- typedef _CharT char_type;
- typedef _Traits traits_type;
- typedef basic_ostream<_CharT, _Traits> ostream_type;
-
- typedef output_iterator_tag iterator_category;
- typedef void value_type;
- typedef void difference_type;
- typedef void pointer;
- typedef void reference;
-
- ostream_iterator(ostream_type& __s) : _M_stream(&__s), _M_string(0) {}
- ostream_iterator(ostream_type& __s, const _CharT* __c)
- : _M_stream(&__s), _M_string(__c) {}
- ostream_iterator<_Tp>& operator=(const _Tp& __value) {
- *_M_stream << __value;
- if (_M_string) *_M_stream << _M_string;
- return *this;
- }
- ostream_iterator<_Tp>& operator*() { return *this; }
- ostream_iterator<_Tp>& operator++() { return *this; }
- ostream_iterator<_Tp>& operator++(int) { return *this; }
-private:
- ostream_type* _M_stream;
- const _CharT* _M_string;
-};
-
-
-// This iterator adapter is 'normal' in the sense that it does not
-// change the semantics of any of the operators of its itererator
-// parameter. Its primary purpose is to convert an iterator that is
-// not a class, e.g. a pointer, into an iterator that is a class.
-// The _Container parameter exists solely so that different containers
-// using this template can instantiate different types, even if the
-// _Iterator parameter is the same.
-template<typename _Iterator, typename _Container>
-class __normal_iterator
- : public iterator<typename iterator_traits<_Iterator>::iterator_category,
- typename iterator_traits<_Iterator>::value_type,
- typename iterator_traits<_Iterator>::difference_type,
- typename iterator_traits<_Iterator>::pointer,
- typename iterator_traits<_Iterator>::reference>
-{
- typedef iterator_traits<_Iterator> _Traits;
+ template<typename _Tp, typename _CharT = char,
+ typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>
+ class istream_iterator
+ : public iterator<input_iterator_tag, _Tp, _Dist, const _Tp*, const _Tp&>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef basic_istream<_CharT, _Traits> istream_type;
+
+ private:
+ istream_type* _M_stream;
+ _Tp _M_value;
+ bool _M_ok;
+
+ public:
+ istream_iterator() : _M_stream(0), _M_ok(false) {}
+ istream_iterator(istream_type& __s) : _M_stream(&__s) { _M_read(); }
+
+ reference
+ operator*() const { return _M_value; }
+
+ pointer
+ operator->() const { return &(operator*()); }
+
+ istream_iterator&
+ operator++()
+ { _M_read(); return *this; }
+
+ istream_iterator
+ operator++(int)
+ {
+ istream_iterator __tmp = *this;
+ _M_read();
+ return __tmp;
+ }
+
+ bool
+ _M_equal(const istream_iterator& __x) const
+ { return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream);}
+
+ private:
+ void _M_read()
+ {
+ _M_ok = (_M_stream && *_M_stream) ? true : false;
+ if (_M_ok)
+ {
+ *_M_stream >> _M_value;
+ _M_ok = *_M_stream ? true : false;
+ }
+ }
+ };
-protected:
- _Iterator _M_current;
+ template<typename _Tp, typename _CharT, typename _Traits, typename _Dist>
+ inline bool
+ operator==(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
+ const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
+ { return __x._M_equal(__y); }
-public:
- typedef __normal_iterator<_Iterator, _Container> normal_iterator_type;
- typedef typename _Traits::iterator_category iterator_category;
- typedef typename _Traits::value_type value_type;
- typedef typename _Traits::difference_type difference_type;
- typedef typename _Traits::pointer pointer;
- typedef typename _Traits::reference reference;
+ template <class _Tp, class _CharT, class _Traits, class _Dist>
+ inline bool
+ operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
+ const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
+ { return !__x._M_equal(__y); }
+
+
+ template<typename _Tp, typename _CharT = char,
+ typename _Traits = char_traits<_CharT> >
+ class ostream_iterator
+ : public iterator<output_iterator_tag, void, void, void, void>
+ {
+ public:
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef basic_ostream<_CharT, _Traits> ostream_type;
- __normal_iterator() : _M_current(_Iterator()) { }
+ private:
+ ostream_type* _M_stream;
+ const _CharT* _M_string;
- explicit __normal_iterator(const _Iterator& __i) : _M_current(__i) { }
+ public:
+ ostream_iterator(ostream_type& __s) : _M_stream(&__s), _M_string(0) {}
+ ostream_iterator(ostream_type& __s, const _CharT* __c)
+ : _M_stream(&__s), _M_string(__c) { }
- // Allow iterator to const_iterator conversion
- template<typename _Iter>
- inline __normal_iterator(const __normal_iterator<_Iter, _Container>& __i)
- : _M_current(__i.base()) { }
+ ostream_iterator&
+ operator=(const _Tp& __value)
+ {
+ *_M_stream << __value;
+ if (_M_string) *_M_stream << _M_string;
+ return *this;
+ }
+
+ ostream_iterator&
+ operator*() { return *this; }
+
+ ostream_iterator&
+ operator++() { return *this; }
+
+ ostream_iterator&
+ operator++(int) { return *this; }
+ };
+
+
+ // This iterator adapter is 'normal' in the sense that it does not
+ // change the semantics of any of the operators of its itererator
+ // parameter. Its primary purpose is to convert an iterator that is
+ // not a class, e.g. a pointer, into an iterator that is a class.
+ // The _Container parameter exists solely so that different containers
+ // using this template can instantiate different types, even if the
+ // _Iterator parameter is the same.
+ template<typename _Iterator, typename _Container>
+ class __normal_iterator
+ : public iterator<typename iterator_traits<_Iterator>::iterator_category,
+ typename iterator_traits<_Iterator>::value_type,
+ typename iterator_traits<_Iterator>::difference_type,
+ typename iterator_traits<_Iterator>::pointer,
+ typename iterator_traits<_Iterator>::reference>
+ {
+ protected:
+ _Iterator _M_current;
+
+ public:
+ typedef typename iterator_traits<_Iterator>::difference_type
+ difference_type;
+ typedef typename iterator_traits<_Iterator>::reference reference;
+ typedef typename iterator_traits<_Iterator>::pointer pointer;
- // Forward iterator requirements
- reference
- operator*() const { return *_M_current; }
+ __normal_iterator() : _M_current(_Iterator()) { }
- pointer
- operator->() const { return _M_current; }
+ explicit
+ __normal_iterator(const _Iterator& __i) : _M_current(__i) { }
- normal_iterator_type&
- operator++() { ++_M_current; return *this; }
+ // Allow iterator to const_iterator conversion
+ template<typename _Iter>
+ inline __normal_iterator(const __normal_iterator<_Iter, _Container>& __i)
+ : _M_current(__i.base()) { }
- normal_iterator_type
- operator++(int) { return __normal_iterator(_M_current++); }
+ // Forward iterator requirements
+ reference
+ operator*() const { return *_M_current; }
+
+ pointer
+ operator->() const { return _M_current; }
+
+ __normal_iterator&
+ operator++() { ++_M_current; return *this; }
+
+ __normal_iterator
+ operator++(int) { return __normal_iterator(_M_current++); }
+
+ // Bidirectional iterator requirements
+ __normal_iterator&
+ operator--() { --_M_current; return *this; }
+
+ __normal_iterator
+ operator--(int) { return __normal_iterator(_M_current--); }
+
+ // Random access iterator requirements
+ reference
+ operator[](const difference_type& __n) const
+ { return _M_current[__n]; }
+
+ __normal_iterator&
+ operator+=(const difference_type& __n)
+ { _M_current += __n; return *this; }
- // Bidirectional iterator requirements
- normal_iterator_type&
- operator--() { --_M_current; return *this; }
+ __normal_iterator
+ operator+(const difference_type& __n) const
+ { return __normal_iterator(_M_current + __n); }
+
+ __normal_iterator&
+ operator-=(const difference_type& __n)
+ { _M_current -= __n; return *this; }
+
+ __normal_iterator
+ operator-(const difference_type& __n) const
+ { return __normal_iterator(_M_current - __n); }
+
+ difference_type
+ operator-(const __normal_iterator& __i) const
+ { return _M_current - __i._M_current; }
+
+ const _Iterator&
+ base() const { return _M_current; }
+ };
- normal_iterator_type
- operator--(int) { return __normal_iterator(_M_current--); }
+ // Forward iterator requirements
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() == __rhs.base(); }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return !(__lhs == __rhs); }
// Random access iterator requirements
- reference
- operator[](const difference_type& __n) const
- { return _M_current[__n]; }
-
- normal_iterator_type&
- operator+=(const difference_type& __n)
- { _M_current += __n; return *this; }
-
- normal_iterator_type
- operator+(const difference_type& __n) const
- { return __normal_iterator(_M_current + __n); }
-
- normal_iterator_type&
- operator-=(const difference_type& __n)
- { _M_current -= __n; return *this; }
-
- normal_iterator_type
- operator-(const difference_type& __n) const
- { return __normal_iterator(_M_current - __n); }
-
- difference_type
- operator-(const normal_iterator_type& __i) const
- { return _M_current - __i._M_current; }
-
- const _Iterator&
- base() const { return _M_current; }
-};
-
-// forward iterator requirements
-
-template<typename _IteratorL, typename _IteratorR, typename _Container>
-inline bool
-operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
- const __normal_iterator<_IteratorR, _Container>& __rhs)
-{ return __lhs.base() == __rhs.base(); }
-
-template<typename _IteratorL, typename _IteratorR, typename _Container>
-inline bool
-operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs,
- const __normal_iterator<_IteratorR, _Container>& __rhs)
-{ return !(__lhs == __rhs); }
-
-// random access iterator requirements
-
-template<typename _IteratorL, typename _IteratorR, typename _Container>
-inline bool
-operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
- const __normal_iterator<_IteratorR, _Container>& __rhs)
-{ return __lhs.base() < __rhs.base(); }
-
-template<typename _IteratorL, typename _IteratorR, typename _Container>
-inline bool
-operator>(const __normal_iterator<_IteratorL, _Container>& __lhs,
- const __normal_iterator<_IteratorR, _Container>& __rhs)
-{ return __rhs < __lhs; }
-
-template<typename _IteratorL, typename _IteratorR, typename _Container>
-inline bool
-operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs,
- const __normal_iterator<_IteratorR, _Container>& __rhs)
-{ return !(__rhs < __lhs); }
-
-template<typename _IteratorL, typename _IteratorR, typename _Container>
-inline bool
-operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs,
- const __normal_iterator<_IteratorR, _Container>& __rhs)
-{ return !(__lhs < __rhs); }
-
-template<typename _Iterator, typename _Container>
-inline __normal_iterator<_Iterator, _Container>
-operator+(__normal_iterator<_Iterator, _Container>::difference_type __n,
- const __normal_iterator<_Iterator, _Container>& __i)
-{ return __normal_iterator<_Iterator, _Container>(__i.base() + __n); }
-
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __lhs.base() < __rhs.base(); }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator>(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return __rhs < __lhs; }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return !(__rhs < __lhs); }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+ inline bool
+ operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ { return !(__lhs < __rhs); }
+
+ template<typename _Iterator, typename _Container>
+ inline __normal_iterator<_Iterator, _Container>
+ operator+(__normal_iterator<_Iterator, _Container>::difference_type __n,
+ const __normal_iterator<_Iterator, _Container>& __i)
+ { return __normal_iterator<_Iterator, _Container>(__i.base() + __n); }
} // namespace std
-#endif /* __SGI_STL_INTERNAL_ITERATOR_H */
+#endif
// Local Variables:
// mode:C++
OpenPOWER on IntegriCloud