C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Defined STL containers moved-from state

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Wed, 22 Jan 2025 13:12:52 -0500
On Wed, 22 Jan 2025, 13:07 Gia Phan via Std-Proposals, <
std-proposals_at_[hidden]> wrote:

> This feels like iterator validation rules to me :).
> It's obvious, though sometimes tricky, just a bit under documented.
>

I disagree that it's under-documented. I think you're just misunderstanding
what the specification says, or expecting it to say something different.




> On Wed, Jan 22, 2025 at 10:03 AM Gia Phan <repulseshipp_at_[hidden]> wrote:
>
>> Ohhh, so it's basically UB for:
>> - Anything that requires reading any member or content of the moved
>> containers,
>> - Modifications like append, push(_back) to it without resetting all of
>> its member/content to a deterministic state (assigning new value,
>> reconstructing)
>>
>> I'll keep these in mind. I was just confused because it's not mentioned
>> anywhere. Thank you!
>>
>> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2025-01-22 18:14:09