public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-3831] libstdc++: Fix documentation for return values of copy algos
@ 2020-10-12 17:14 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2020-10-12 17:14 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:ae3967caffea9c9b9f0f9dfe42a4f59e715e1a61

commit r11-3831-gae3967caffea9c9b9f0f9dfe42a4f59e715e1a61
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Oct 12 18:14:01 2020 +0100

    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.

Diff:
---
 libstdc++-v3/include/bits/stl_algobase.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
index 3e9ec32340e..d19f68871ab 100644
--- a/libstdc++-v3/include/bits/stl_algobase.h
+++ b/libstdc++-v3/include/bits/stl_algobase.h
@@ -594,7 +594,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
@@ -627,7 +627,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
@@ -830,7 +830,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.
@@ -866,7 +866,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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-12 17:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-12 17:14 [gcc r11-3831] libstdc++: Fix documentation for return values of copy algos Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).