C++ Logo


Advanced search

Re: Accessing data members in constructors' function try bocks

From: Frank B. Brokken <f.b.brokken_at_[hidden]>
Date: Fri, 20 Jan 2023 17:33:33 +0100
Dear Edward Catmur, you wrote:


> > ... (or am I missing something and are there some spooky
> > things going on by the time the handlers begin their executions?).
> There may be. Implementations have freedom to poison the memory to help
> detect bugs, or to reuse it for their own purposes, and so on.

Aaah! That solves my issue. I don't think I ever encountered memory poisoning,
but that's of course not important. If memory poisoning is possible, then I
understand that accessing such memory is invalid.

So let me thank you again for all your replies: the important gain I got from
your replies is that I now understand why function-try-block handlers of
constructors formally can't access their basic type data members anymore.

Once again, thanks for your extensive and valuable replies.

Have a nice weekend!

    Frank B. Brokken
    (+31) 6 5353 2509
    PGP Key Fingerprint: DF32 13DE B156 7732 E65E  3B4D 7DB2 A8BE EAE4 D8AA

Received on 2023-01-20 16:33:37