OSDN Git Service

2004-06-14 Paolo Carlini <pcarlini@suse.de>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / include / ext / iterator
index 73fd6c8..12edab9 100644 (file)
@@ -1,6 +1,6 @@
 // HP/SGI iterator extensions -*- C++ -*-
 
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
  * purpose.  It is provided "as is" without express or implied warranty.
  */
 
-/*  @file dont_know_what_to_call_this_yet
- *  This header file is an extension to the Standard C++ Library.  You should
- *  use the "ext/" path prefix in your @c #include statements.
+/** @file ext/iterator
+ *  This file is a GNU extension to the Standard C++ Library (possibly
+ *  containing extensions from the HP/SGI STL subset).  You should only
+ *  include this header if you are using GCC 3 or later.
  */
 
 #ifndef _EXT_ITERATOR
-#define _EXT_ITERATOR
+#define _EXT_ITERATOR 1
 
 #pragma GCC system_header
+
 #include <bits/concept_check.h>
-#include <bits/std_iterator.h>
+#include <iterator>
 
 namespace __gnu_cxx
 {
-
-  // There are two signatures for distance.  In addition to the one taking
-  // two iterators and returning a result, there is another taking two
-  // iterators and a reference-to-result variable, and returning nothing.
-  // The latter seems to be an SGI extension.   -- pedwards
+  // There are two signatures for distance.  In addition to the one
+  // taking two iterators and returning a result, there is another
+  // taking two iterators and a reference-to-result variable, and
+  // returning nothing.  The latter seems to be an SGI extension.
+  // -- pedwards
   template<typename _InputIterator, typename _Distance>
     inline void
     __distance(_InputIterator __first, _InputIterator __last,
               _Distance& __n, std::input_iterator_tag)
     {
       // concept requirements
-      __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>)
-      while (__first != __last) { ++__first; ++__n; }
+      __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+      while (__first != __last)
+       {
+         ++__first;
+         ++__n;
+       }
     }
 
   template<typename _RandomAccessIterator, typename _Distance>
     inline void
-    __distance(_RandomAccessIterator __first, _RandomAccessIterator __last, 
+    __distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
               _Distance& __n, std::random_access_iterator_tag)
     {
       // concept requirements
-      __glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIterator>)
+      __glibcxx_function_requires(_RandomAccessIteratorConcept<
+                                 _RandomAccessIterator>)
       __n += __last - __first;
     }
 
+  /**
+   *  This is an SGI extension.
+   *  @ingroup SGIextensions
+   *  @doctodo
+  */
   template<typename _InputIterator, typename _Distance>
     inline void
     distance(_InputIterator __first, _InputIterator __last,
@@ -100,8 +112,7 @@ namespace __gnu_cxx
       // concept requirements -- taken care of in __distance
       __distance(__first, __last, __n, std::__iterator_category(__first));
     }
-
 } // namespace __gnu_cxx
 
-#endif /* _EXT_ITERATOR */
+#endif