// Iterators -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
_GLIBCXX_BEGIN_NAMESPACE(std)
+ /**
+ * @addtogroup iterators
+ * @{
+ */
+
// 24.4.1 Reverse iterators
/**
- * "Bidirectional and random access iterators have corresponding reverse
+ * Bidirectional and random access iterators have corresponding reverse
* %iterator adaptors that iterate through the data structure in the
* opposite direction. They have the same signatures as the corresponding
* iterators. The fundamental relation between a reverse %iterator and its
* &*(reverse_iterator(i)) == &*(i - 1)
* @endcode
*
- * This mapping is dictated by the fact that while there is always a
+ * <em>This mapping is dictated by the fact that while there is always a
* pointer past the end of an array, there might not be a valid pointer
- * before the beginning of an array." [24.4.1]/1,2
+ * before the beginning of an array.</em> [24.4.1]/1,2
*
* Reverse iterators can be tricky and surprising at first. Their
* semantics make sense, however, and the trickiness is a side effect of
protected:
_Iterator current;
- public:
- 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;
+ typedef iterator_traits<_Iterator> __traits_type;
public:
+ typedef _Iterator iterator_type;
+ typedef typename __traits_type::difference_type difference_type;
+ typedef typename __traits_type::pointer pointer;
+ typedef typename __traits_type::reference reference;
+
/**
* The default constructor default-initializes member @p current.
* If it is a pointer, that means it is zero-initialized.
* reference-to-const T for container<T>.
* @return This %iterator, for chained operations.
*
- * This kind of %iterator doesn't really have a "position" in the
+ * This kind of %iterator doesn't really have a @a position in the
* container (you can think of the position as being permanently at
* the end, if you like). Assigning a value to the %iterator will
* always append the value to the end of the container.
operator*()
{ return *this; }
- /// Simply returns *this. (This %iterator does not "move".)
+ /// Simply returns *this. (This %iterator does not @a move.)
back_insert_iterator&
operator++()
{ return *this; }
- /// Simply returns *this. (This %iterator does not "move".)
+ /// Simply returns *this. (This %iterator does not @a move.)
back_insert_iterator
operator++(int)
{ return *this; }
* reference-to-const T for container<T>.
* @return This %iterator, for chained operations.
*
- * This kind of %iterator doesn't really have a "position" in the
+ * This kind of %iterator doesn't really have a @a position in the
* container (you can think of the position as being permanently at
* the front, if you like). Assigning a value to the %iterator will
* always prepend the value to the front of the container.
operator*()
{ return *this; }
- /// Simply returns *this. (This %iterator does not "move".)
+ /// Simply returns *this. (This %iterator does not @a move.)
front_insert_iterator&
operator++()
{ return *this; }
- /// Simply returns *this. (This %iterator does not "move".)
+ /// Simply returns *this. (This %iterator does not @a move.)
front_insert_iterator
operator++(int)
{ return *this; }
operator*()
{ return *this; }
- /// Simply returns *this. (This %iterator does not "move".)
+ /// Simply returns *this. (This %iterator does not @a move.)
insert_iterator&
operator++()
{ return *this; }
- /// Simply returns *this. (This %iterator does not "move".)
+ /// Simply returns *this. (This %iterator does not @a move.)
insert_iterator&
operator++(int)
{ return *this; }
typename _Container::iterator(__i));
}
+ // @} group iterators
+
_GLIBCXX_END_NAMESPACE
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
- // This iterator adapter is 'normal' in the sense that it does not
+ // This iterator adapter is @a normal in the sense that it does not
// change the semantics of any of the operators of its iterator
// 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.
protected:
_Iterator _M_current;
+ typedef iterator_traits<_Iterator> __traits_type;
+
public:
- typedef _Iterator iterator_type;
- typedef typename iterator_traits<_Iterator>::iterator_category
- iterator_category;
- typedef typename iterator_traits<_Iterator>::value_type value_type;
- typedef typename iterator_traits<_Iterator>::difference_type
- difference_type;
- typedef typename iterator_traits<_Iterator>::reference reference;
- typedef typename iterator_traits<_Iterator>::pointer pointer;
+ typedef _Iterator iterator_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::reference reference;
+ typedef typename __traits_type::pointer pointer;
__normal_iterator() : _M_current(_Iterator()) { }
_GLIBCXX_BEGIN_NAMESPACE(std)
+ /**
+ * @addtogroup iterators
+ * @{
+ */
+
// 24.4.3 Move iterators
/**
* Class template move_iterator is an iterator adapter with the same
protected:
_Iterator _M_current;
+ typedef iterator_traits<_Iterator> __traits_type;
+
public:
- typedef _Iterator iterator_type;
- typedef typename iterator_traits<_Iterator>::difference_type
- difference_type;
+ typedef _Iterator iterator_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;
// NB: DR 680.
- typedef _Iterator pointer;
- typedef typename iterator_traits<_Iterator>::value_type value_type;
- typedef typename iterator_traits<_Iterator>::iterator_category
- iterator_category;
- typedef value_type&& reference;
+ typedef _Iterator pointer;
+ typedef value_type&& reference;
- public:
move_iterator()
: _M_current() { }
make_move_iterator(const _Iterator& __i)
{ return move_iterator<_Iterator>(__i); }
+ // @} group iterators
+
_GLIBCXX_END_NAMESPACE
#define _GLIBCXX_MAKE_MOVE_ITERATOR(_Iter) std::make_move_iterator(_Iter)