C++ Logo

std-proposals

Advanced search

Re: [std-proposals] vector::push_back must not invalidate past-the-end iterator

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Tue, 9 Dec 2025 09:21:39 +0000
On Tue, 9 Dec 2025 at 08:26, Nikl Kelbon <kelbonage_at_[hidden]> wrote:

> > This is not motivation for changing it, you're still just saying it's
> possible.
>
> Did you read the code? Or how it may be motivated other than code examples?
>


I would like to see discussion of why the invalidation rule is there in the
first place, with discussion of whether that was a good reason, and whether
it still applies now.

The current wording was adding for C++20 by
https://cplusplus.github.io/LWG/issue3077 but doesn't actually give
rationale for the behaviour, it just re-confirms it and clarifies the
wording.

Received on 2025-12-09 09:21:58