note - the point is, e never become invalid. It is just losing its meaning as "the end" iterator.
e.g. the iterator stay valid, but is not point to the end()

On Tue, Dec 9, 2025 at 10:55 AM Ville Voutilainen via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
On Tue, 9 Dec 2025 at 10:51, David Brown via Std-Proposals
<std-proposals@lists.isocpp.org> wrote:
> void append(iterator b, iterator e) {
>         for (auto n = e - b; n; n--, ++b) {
>                 vec.push_back(*b);
>         }
> }
>
> Won't that give the same set of push_back's without needing "e" to
> remain valid?

It does so by completely changing the requirements for the iterators
that code works with. But considering
just the example provided, it indeed doesn't change anything, and does
provide an alternative way
that was claimed to be impossible to write. :)
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals