]> gcc.gnu.org Git - gcc.git/commitdiff
stl_algobase.h (struct __iter_base): Add.
authorFrançois Dumont <francois.cppdevs@free.fr>
Thu, 28 Jan 2010 22:29:52 +0000 (23:29 +0100)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 28 Jan 2010 22:29:52 +0000 (22:29 +0000)
2010-01-28  François Dumont  <francois.cppdevs@free.fr>

* include/bits/stl_algobase.h (struct __iter_base): Add.
(__niter_base, __miter_base): Adjust, use the latter.

From-SVN: r156335

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_algobase.h

index 776e4fe5e7cdd5b6b8d42c4991628185d5a930f2..65422238034418e6f143981cf148c50fcb4dd9c5 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-28  François Dumont  <francois.cppdevs@free.fr>
+
+       * include/bits/stl_algobase.h (struct __iter_base): Add.
+       (__niter_base, __miter_base): Adjust, use the latter.
+
 2010-01-28  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * testsuite/21_strings/basic_string/element_access/char/21674.cc:
index bc04723439e5af9f783e3e72e03ee296c53bfd90..5f6c648cc0c0f19acdb146963b04b2d5fe39a83c 100644 (file)
@@ -1,6 +1,6 @@
 // Core algorithmic facilities -*- 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
@@ -259,11 +259,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     }
 
 
-  // If _Iterator is a __normal_iterator return its base (a plain pointer,
-  // normally) otherwise return it untouched.  See copy, fill, ... 
-  template<typename _Iterator,
-          bool _IsNormal = __is_normal_iterator<_Iterator>::__value>
-    struct __niter_base
+  // If _Iterator has a base returns it otherwise _Iterator is returned
+  // untouched
+  template<typename _Iterator, bool _HasBase>
+    struct __iter_base
     {
       static _Iterator
       __b(_Iterator __it)
@@ -271,30 +270,25 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     };
 
   template<typename _Iterator>
-    struct __niter_base<_Iterator, true>
+    struct __iter_base<_Iterator, true>
     {
       static typename _Iterator::iterator_type
       __b(_Iterator __it)
       { return __it.base(); }
     };
 
-  // Likewise, for move_iterator.
-  template<typename _Iterator,
-          bool _IsMove = __is_move_iterator<_Iterator>::__value>
-    struct __miter_base
-    {
-      static _Iterator
-      __b(_Iterator __it)
-      { return __it; }
-    };
+  // If _Iterator is a __normal_iterator return its base (a plain pointer,
+  // normally) otherwise return it untouched.  See copy, fill, ... 
+  template<typename _Iterator>
+    struct __niter_base
+    : __iter_base<_Iterator, __is_normal_iterator<_Iterator>::__value>
+    { };
 
+  // Likewise, for move_iterator.
   template<typename _Iterator>
-    struct __miter_base<_Iterator, true>
-    {
-      static typename _Iterator::iterator_type
-      __b(_Iterator __it)
-      { return __it.base(); }
-    };
+    struct __miter_base
+    : __iter_base<_Iterator, __is_move_iterator<_Iterator>::__value>
+    { };
 
   // All of these auxiliary structs serve two purposes.  (1) Replace
   // calls to copy with memmove whenever possible.  (Memmove, not memcpy,
This page took 0.079303 seconds and 5 git commands to generate.