C++ Logo

std-proposals

Advanced search

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

From: Gia Phan <repulseshipp_at_[hidden]>
Date: Wed, 22 Jan 2025 10:06:47 -0800
This feels like iterator validation rules to me :).
It's obvious, though sometimes tricky, just a bit under documented.

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!
>
>

Received on 2025-01-22 18:06:59