From: Jonathan Wakely Date: Mon, 12 Oct 2020 17:14:01 +0000 (+0100) Subject: libstdc++: Fix documentation for return values of copy algos X-Git-Tag: releases/gcc-10.3.0~746 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fa9ec49e372e148f58ffe0f360fd3f3d20cd31d;p=thirdparty%2Fgcc.git libstdc++: Fix documentation for return values of copy algos The doxygen comments for these algos all incorrectly claim to use (first - last) as the difference from the start of the output range to the return value. As reported on the mailing list by Johannes Choo, it should be (last - first). libstdc++-v3/ChangeLog: * include/bits/stl_algobase.h (copy, move, copy_backward) (move_backward): Fix documentation for returned iterator. (cherry picked from commit ae3967caffea9c9b9f0f9dfe42a4f59e715e1a61) --- diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h index d41a7df57fbf..e397ccf64c3d 100644 --- a/libstdc++-v3/include/bits/stl_algobase.h +++ b/libstdc++-v3/include/bits/stl_algobase.h @@ -543,7 +543,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER * @param __first An input iterator. * @param __last An input iterator. * @param __result An output iterator. - * @return result + (first - last) + * @return result + (last - first) * * This inline function will boil down to a call to @c memmove whenever * possible. Failing that, if random access iterators are passed, then the @@ -576,7 +576,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER * @param __first An input iterator. * @param __last An input iterator. * @param __result An output iterator. - * @return result + (first - last) + * @return result + (last - first) * * This inline function will boil down to a call to @c memmove whenever * possible. Failing that, if random access iterators are passed, then the @@ -779,7 +779,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER * @param __first A bidirectional iterator. * @param __last A bidirectional iterator. * @param __result A bidirectional iterator. - * @return result - (first - last) + * @return result - (last - first) * * The function has the same effect as copy, but starts at the end of the * range and works its way to the start, returning the start of the result. @@ -815,7 +815,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER * @param __first A bidirectional iterator. * @param __last A bidirectional iterator. * @param __result A bidirectional iterator. - * @return result - (first - last) + * @return result - (last - first) * * The function has the same effect as move, but starts at the end of the * range and works its way to the start, returning the start of the result.