https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64814

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Anquietas from comment #5)
> "Effects: For each non-negative integer i < n, performs *(result + i) =
> *(first + i)."
> Since it's talking about input iterators where (first + n) isn't valid I

See 25.1 [algorithms.general] p12.

> think we can interpret this as n applications each of ++first and *first.

No, i < n so (first+n) is not needed and only n-1 applications of ++first are
required. It is unspecified whether the algorithm increments the iterator again
after the last write, but at least two implementations do not perform that
final increment.

So I'm closing this as not a bug. If
http://cplusplus.github.io/LWG/lwg-active.html#2242 becomes a defect and
changes something we will make whatever change is needed, but I don't think we
have a bug now in libstdc++.

Reply via email to