return value in std::copy documentation seems to be wrong

Jonathan Wakely jwakely.gcc@gmail.com
Sun Oct 11 12:37:04 GMT 2020


On Sun, 11 Oct 2020 at 08:18, Johannes Choo via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> Hi all,
>
> I'm a beginner with C++, but the documentation for std::copy seems to be
> mistaken in its documented return value (
> https://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01486.html#ga894f503412130680dc19c87af289f4f4
> ). It reads,
>
> Returns: result + (first - last)
>
> where the copy function signature is std::copy(first, last, result).
>
> Shouldn't it be
>
> result + (last - first) ?

Yes, well spotted! I'll fix it, thanks.


More information about the Libstdc++ mailing list