// Types used in iterator implementation -*- 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
#pragma GCC system_header
#include <bits/c++config.h>
-#include <cstddef>
_GLIBCXX_BEGIN_NAMESPACE(std)
/**
* @defgroup iterators Iterators
+ * Abstractions for uniform iterating through various underlying types.
+ */
+ //@{
+
+ /**
+ * @defgroup iterator_tags Iterator Tags
* These are empty types, used to distinguish different iterators. The
* distinction is not made by what they contain, but simply by what they
* are. Different underlying algorithms can then be used based on the
//@{
/// Marking input iterators.
struct input_iterator_tag { };
+
/// Marking output iterators.
struct output_iterator_tag { };
+
/// Forward iterators support a superset of input iterator operations.
struct forward_iterator_tag : public input_iterator_tag { };
+
/// Bidirectional iterators support a superset of forward iterator
/// operations.
struct bidirectional_iterator_tag : public forward_iterator_tag { };
- /// Random-access iterators support a superset of bidirectional iterator
- /// operations.
- struct random_access_iterator_tag : public bidirectional_iterator_tag { };
+ /// Random-access iterators support a superset of bidirectional
+ /// iterator operations.
+ struct random_access_iterator_tag : public bidirectional_iterator_tag { };
+ //@}
/**
* @brief Common %iterator class.
};
/**
+ * @brief Traits class for iterators.
+ *
* This class does nothing but define nested typedefs. The general
- * version simply "forwards" the nested typedefs from the Iterator
+ * version simply @a forwards the nested typedefs from the Iterator
* argument. Specialized versions for pointers and pointers-to-const
* provide tighter, more correct semantics.
*/
typedef typename _Iterator::reference reference;
};
+ /// Partial specialization for pointer types.
template<typename _Tp>
struct iterator_traits<_Tp*>
{
typedef _Tp& reference;
};
+ /// Partial specialization for const pointer types.
template<typename _Tp>
struct iterator_traits<const _Tp*>
{