Date: Mon, 8 Dec 2025 19:30:02 +0000
On Mon, 8 Dec 2025, 18:56 Nikl Kelbon, <kelbonage_at_[hidden]> wrote:
> 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?
>
As Jason said:
> 1. Is this actually a "common pattern"? The core of your proposal relies
on accepting the idea that a lot of people do this even though it's
formally UB. Do you have any evidence of it beyond your own code?
So I think it's relevant here too. It's currently UB, so anybody who tests
with debug mode assertions enabled will not be using invalidated end
iterators. Do you have evidence that many people are doing this, and have a
good reason (other than not knowing it's UB) to do it?
> пн, 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
>>
>>
> 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?
>
As Jason said:
> 1. Is this actually a "common pattern"? The core of your proposal relies
on accepting the idea that a lot of people do this even though it's
formally UB. Do you have any evidence of it beyond your own code?
So I think it's relevant here too. It's currently UB, so anybody who tests
with debug mode assertions enabled will not be using invalidated end
iterators. Do you have evidence that many people are doing this, and have a
good reason (other than not knowing it's UB) to do it?
> пн, 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 19:30:21
