]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
stl_algobase.h (fill(const _Deque_iterator<>&, const _Deque_iterator<>&, const _Tp...
authorPaolo Carlini <pcarlini@suse.de>
Wed, 9 Aug 2006 09:56:15 +0000 (09:56 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 9 Aug 2006 09:56:15 +0000 (09:56 +0000)
2006-08-09  Paolo Carlini  <pcarlini@suse.de>

* include/bits/stl_algobase.h (fill(const _Deque_iterator<>&,
const _Deque_iterator<>&, const _Tp&)): Move...
* include/bits/deque.tcc: ... here.
* include/bits/stl_deque.h: Declare.

From-SVN: r116034

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/deque.tcc
libstdc++-v3/include/bits/stl_algobase.h
libstdc++-v3/include/bits/stl_deque.h

index 7983c7eb3fd1b7460d16a0b303c5b6c9869e3448..efb06c93b938009d20731fc7f1c736ab580fb525 100644 (file)
@@ -1,3 +1,10 @@
+2006-08-09  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/bits/stl_algobase.h (fill(const _Deque_iterator<>&,
+       const _Deque_iterator<>&, const _Tp&)): Move...
+       * include/bits/deque.tcc: ... here.
+       * include/bits/stl_deque.h: Declare.
+
 2006-08-06  Paolo Carlini  <pcarlini@suse.de>
 
        PR libstdc++/16611
index 294a0dd6a6c666d50c2f7db46a419d1a86cc5e55..8740101a299389d8b7d6024a3c4aea6c36fa3395 100644 (file)
@@ -744,6 +744,28 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
       this->_M_impl._M_finish._M_set_node(__new_nstart + __old_num_nodes - 1);
     }
 
+  // Overload for deque::iterators, exploiting the "segmented-iterator
+  // optimization".  NB: leave const_iterators alone!
+  template<typename _Tp>
+    void
+    fill(const _Deque_iterator<_Tp, _Tp&, _Tp*>& __first,
+        const _Deque_iterator<_Tp, _Tp&, _Tp*>& __last, const _Tp& __value)
+    {
+      typedef typename _Deque_iterator<_Tp, _Tp&, _Tp*>::_Self _Self;
+
+      for (typename _Self::_Map_pointer __node = __first._M_node + 1;
+           __node < __last._M_node; ++__node)
+       std::fill(*__node, *__node + _Self::_S_buffer_size(), __value);
+
+      if (__first._M_node != __last._M_node)
+       {
+         std::fill(__first._M_cur, __first._M_last, __value);
+         std::fill(__last._M_first, __last._M_cur, __value);
+       }
+      else
+       std::fill(__first._M_cur, __last._M_cur, __value);
+    }
+
 _GLIBCXX_END_NESTED_NAMESPACE
 
 #endif
index da93e1588f68e0e33a99b21beeb3b2e72d703177..9507241964a9fa58e9296fcd21db0fc021310da2 100644 (file)
@@ -618,32 +618,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     std::memset(__first, static_cast<unsigned char>(__tmp), __last - __first);
   }
 
-  template<typename _Tp, typename _Ref, typename _Ptr>
-    struct _Deque_iterator;
-
-  // Overload for deque::iterators, exploiting the "segmented-iterator
-  // optimization".  NB: leave const_iterators alone!
-  template<typename _Tp>
-    void
-    fill(const _Deque_iterator<_Tp, _Tp&, _Tp*>& __first,
-        const _Deque_iterator<_Tp, _Tp&, _Tp*>& __last, const _Tp& __value)
-    {
-      typedef typename _Deque_iterator<_Tp, _Tp&, _Tp*>::_Self _Self;
-
-      for (typename _Self::_Map_pointer __node = __first._M_node + 1;
-           __node < __last._M_node; ++__node)
-       std::fill(*__node, *__node + _Self::_S_buffer_size(), __value);
-
-      if (__first._M_node != __last._M_node)
-       {
-         std::fill(__first._M_cur, __first._M_last, __value);
-         std::fill(__last._M_first, __last._M_cur, __value);
-       }
-      else
-       std::fill(__first._M_cur, __last._M_cur, __value);
-    }
-
-
   template<bool>
     struct __fill_n
     {
index 8f3fc99f61ef3797abe0bc2a8e0dc30656962a34..ffa58744f991f49c182799808d0bf6c83c5c9c4b 100644 (file)
@@ -350,6 +350,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
     operator+(ptrdiff_t __n, const _Deque_iterator<_Tp, _Ref, _Ptr>& __x)
     { return __x + __n; }
 
+  template<typename _Tp>
+    void
+    fill(const _Deque_iterator<_Tp, _Tp&, _Tp*>& __first,
+        const _Deque_iterator<_Tp, _Tp&, _Tp*>& __last, const _Tp& __value);
+
   /**
    *  @if maint
    *  Deque base class.  This class provides the unified face for %deque's