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).