From 8246b3148ea869d8f2cc2d420312feed719943db Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 11 Dec 2009 17:54:37 +0000 Subject: [PATCH] PR libstdc++/22634, DR 539 [Ready] 2009-12-11 Paolo Carlini 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 . * doc/xml/manual/intro.xml: Add an entry for DR 539. From-SVN: r155173 --- libstdc++-v3/ChangeLog | 8 ++++++++ libstdc++-v3/doc/xml/manual/intro.xml | 8 ++++++++ libstdc++-v3/include/bits/stl_numeric.h | 11 +++++++++-- libstdc++-v3/include/std/numeric | 1 - 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 31224f32367..68930acc1d8 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2009-12-11 Paolo Carlini + + 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 . + * doc/xml/manual/intro.xml: Add an entry for DR 539. + 2009-12-11 Paolo Carlini * doc/html/ext/lwg-active.html: Update to Revision R68. diff --git a/libstdc++-v3/doc/xml/manual/intro.xml b/libstdc++-v3/doc/xml/manual/intro.xml index da06cd90525..1c5e7f64e55 100644 --- a/libstdc++-v3/doc/xml/manual/intro.xml +++ b/libstdc++-v3/doc/xml/manual/intro.xml @@ -699,6 +699,14 @@ requirements of the license of GCC. input_iterator' value_type. + 539: + partial_sum and adjacent_difference should mention + requirements + + We were almost doing the right thing, just use std::move + in adjacent_difference. + + 541: shared_ptr template assignment and void diff --git a/libstdc++-v3/include/bits/stl_numeric.h b/libstdc++-v3/include/bits/stl_numeric.h index 5edf2bc5d9f..1adddf6babc 100644 --- a/libstdc++-v3/include/bits/stl_numeric.h +++ b/libstdc++-v3/include/bits/stl_numeric.h @@ -59,6 +59,7 @@ #include #include +#include // 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 _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 @@ -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; } diff --git a/libstdc++-v3/include/std/numeric b/libstdc++-v3/include/std/numeric index 43d76d98037..1acedf4e634 100644 --- a/libstdc++-v3/include/std/numeric +++ b/libstdc++-v3/include/std/numeric @@ -58,7 +58,6 @@ #pragma GCC system_header #include -#include #include #include