Date: Sun, 27 Jul 2025 02:06:13 +0100
On Sun, Jul 27, 2025 at 1:55 AM Jason McKesson wrote:
>
> Since that `char[]` has not had its lifetime ended, you can look at
> those bytes. But there is nothing in the standard that defines what
> shall be in them. Once the object's lifetime ended, the contents of
> its storage became unspecified.
I wonder if this is so that a debugger can, if it wants to, zero out
the bytes of any object after its destroyed?
(By the way my previous code should have aligned the global char array
as max_align_t)
>
> Since that `char[]` has not had its lifetime ended, you can look at
> those bytes. But there is nothing in the standard that defines what
> shall be in them. Once the object's lifetime ended, the contents of
> its storage became unspecified.
I wonder if this is so that a debugger can, if it wants to, zero out
the bytes of any object after its destroyed?
(By the way my previous code should have aligned the global char array
as max_align_t)
Received on 2025-07-27 01:06:24