return value in std::copy documentation seems to be wrong
Johannes Choo
jhanschoo@gmail.com
Sun Oct 11 13:00:32 GMT 2020
Thanks! Also note that an analogous mistake is present in std::copy_backward
On Sun, Oct 11, 2020 at 8:37 PM Jonathan Wakely <jwakely.gcc@gmail.com>
wrote:
> 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.
>
--
Bests,
Johannes
Email: jhanschoo@gmail.com
Skype: jhanschoo
Mobile: +6584817735
More information about the Libstdc++
mailing list