C++ Logo

std-proposals

Advanced search

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

From: Nikl Kelbon <kelbonage_at_[hidden]>
Date: Mon, 8 Dec 2025 23:56:10 +0500
Thats what standard exists for. Standard decides what is ub and what is not
ub. How its even may be argument "its ub" in discussion about changing
standard?

пн, 8 дек. 2025 г. в 23:53, Jonathan Wakely <cxx_at_[hidden]>:

>
>
> On Mon, 8 Dec 2025 at 18:42, Nikl Kelbon via Std-Proposals <
> std-proposals_at_[hidden]> wrote:
>
>> About this:
>>
>> > There is no other container where getting an end iterator and
>> inserting an element into the end of the container would *ever* leave
>> that end iterator to be pointing to something valid. Not `list`, not
>> `deque`
>>
>> https://godbolt.org/z/ndePjE9c6
>>
>> It works for deque. Its possible
>>
>
> It's UB for deque as well though:
> https://godbolt.org/z/6a7zo5Y5E
>
>

Received on 2025-12-08 18:56:26