OSDN Git Service

2009-12-11 Paolo Carlini <paolo.carlini@oracle.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Dec 2009 17:54:37 +0000 (17:54 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Dec 2009 17:54:37 +0000 (17:54 +0000)
PR libstdc++/22634, DR 539 [Ready]
* include/bits/stl_numeric.h (adjacent_difference): Use std::move
at the end of the loop body, per the Ready resolution.
* include/std/numeric: Do not include unnecessarily <cstddef>.
* doc/xml/manual/intro.xml: Add an entry for DR 539.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155173 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/doc/xml/manual/intro.xml
libstdc++-v3/include/bits/stl_numeric.h
libstdc++-v3/include/std/numeric

index 31224f3..68930ac 100644 (file)
@@ -1,5 +1,13 @@
 2009-12-11  Paolo Carlini  <paolo.carlini@oracle.com>
 
+       PR libstdc++/22634, DR 539 [Ready]
+       * include/bits/stl_numeric.h (adjacent_difference): Use std::move
+       at the end of the loop body, per the Ready resolution.
+       * include/std/numeric: Do not include unnecessarily <cstddef>.
+       * doc/xml/manual/intro.xml: Add an entry for DR 539.
+
+2009-12-11  Paolo Carlini  <paolo.carlini@oracle.com>
+
        * doc/html/ext/lwg-active.html: Update to Revision R68.
        * doc/html/ext/lwg-closed.html: Likewise.
        * doc/html/ext/lwg-defects.html: Likewise.
index da06cd9..1c5e7f6 100644 (file)
@@ -699,6 +699,14 @@ requirements of the license of GCC.
         input_iterator' value_type.
     </para></listitem></varlistentry>
 
+    <varlistentry><term><ulink url="../ext/lwg-active.html#539">539</ulink>:
+        <emphasis>partial_sum and adjacent_difference should mention
+            requirements</emphasis>
+    </term>
+    <listitem><para>We were almost doing the right thing, just use std::move
+        in adjacent_difference.
+    </para></listitem></varlistentry>
+
     <varlistentry><term><ulink url="../ext/lwg-defects.html#541">541</ulink>:
         <emphasis>shared_ptr template assignment and void</emphasis>
     </term>
index 5edf2bc..1adddf6 100644 (file)
@@ -59,6 +59,7 @@
 
 #include <bits/concept_check.h>
 #include <debug/debug.h>
+#include <bits/move.h> // For _GLIBCXX_MOVE
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
 
@@ -302,6 +303,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P)
    *  @param  last  End of input range.
    *  @param  result  Output to write sums to.
    *  @return  Iterator pointing just beyond the values written to result.
+   *
+   *  _GLIBCXX_RESOLVE_LIB_DEFECTS
+   *  DR 539. partial_sum and adjacent_difference should mention requirements
    */
   template<typename _InputIterator, typename _OutputIterator>
     _OutputIterator
@@ -324,7 +328,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P)
        {
          _ValueType __tmp = *__first;
          *++__result = __tmp - __value;
-         __value = __tmp;
+         __value = _GLIBCXX_MOVE(__tmp);
        }
       return ++__result;
     }
@@ -340,6 +344,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P)
    *  @param  last  End of input range.
    *  @param  result  Output to write sums to.
    *  @return  Iterator pointing just beyond the values written to result.
+   *
+   *  _GLIBCXX_RESOLVE_LIB_DEFECTS
+   *  DR 539. partial_sum and adjacent_difference should mention requirements
    */
   template<typename _InputIterator, typename _OutputIterator,
           typename _BinaryOperation>
@@ -363,7 +370,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P)
        {
          _ValueType __tmp = *__first;
          *++__result = __binary_op(__tmp, __value);
-         __value = __tmp;
+         __value = _GLIBCXX_MOVE(__tmp);
        }
       return ++__result;
     }
index 43d76d9..1acedf4 100644 (file)
@@ -58,7 +58,6 @@
 #pragma GCC system_header
 
 #include <bits/c++config.h>
-#include <cstddef>
 #include <bits/stl_iterator_base_types.h>
 #include <bits/stl_numeric.h>