[Bug libstdc++/87982] No error for std::generate_n(ptr, ptr, f)

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Apr 28 19:13:00 GMT 2019


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

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jan van Dijk from comment #5)
> Somewhat off-topic: IMHO the standard is not explicit about the fact that
> gen() is (of course) to be invoked separately for every element in the range:
> "The generate_n algorithms invoke the function object gen and assign the
> return value of gen through all the iterators in the range...". But that may
> be me not being a native English speaker. The libstdc++ docs are more
> helpful for sure.

The current working draft is clear:
Assigns the result of successive evaluations of gen() through each iterator in
the range [first, first + N).


More information about the Gcc-bugs mailing list