Date: Wed, 12 Aug 2026 00:29:23 +0200
On 2026-08-12 00:18, Ville Voutilainen wrote:
> On Wed, 12 Aug 2026 at 01:14, Henry Skoglund via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
>>>>>> Hi, once poisoned I think it should not be allowed to be reused. I.e.
>>>>>> issue a compiler error like:
>>>>>> double raw;
>>>>>> forget raw;
>>>>>> int raw; // <--- error: raw is forgotten and cannot be resurrected
>>>>> Exactly. Make name lookup still find the name, but make it an error to
>>>>> find a poisoned name.
>>>> Then "forget" is not the right word, since the name is clearly not
>>>> forgotten.
>>> Sure, agreed.
>> Yeah the compiler needs to remember it, since the destructor still have
>> to run in the same place (end of scope, as if there was no forget
>> statement).
> That's not a thing that affects whether the name can be used after new
> declarations after poisoning an old name.
> The compiler doesn't need an object's name to make sure it's correctly
> cleaned up.
I see, got it.
>> So "forget" is indeed a bit of a misnomer, I was toying with other verbs
>> like "begone", "perish", "ban". But "forget" kind of nails it anyway :-)
> you could name it std::poison_name(). Or perhaps to avoid untoward
> connotations, std::disable_name().
>
> And no, that doesn't require including a header.
Good idea with a std:: prefix, avoids breaking someone's code that has a
type called "forget".
What about std::redact()?
> On Wed, 12 Aug 2026 at 01:14, Henry Skoglund via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
>>>>>> Hi, once poisoned I think it should not be allowed to be reused. I.e.
>>>>>> issue a compiler error like:
>>>>>> double raw;
>>>>>> forget raw;
>>>>>> int raw; // <--- error: raw is forgotten and cannot be resurrected
>>>>> Exactly. Make name lookup still find the name, but make it an error to
>>>>> find a poisoned name.
>>>> Then "forget" is not the right word, since the name is clearly not
>>>> forgotten.
>>> Sure, agreed.
>> Yeah the compiler needs to remember it, since the destructor still have
>> to run in the same place (end of scope, as if there was no forget
>> statement).
> That's not a thing that affects whether the name can be used after new
> declarations after poisoning an old name.
> The compiler doesn't need an object's name to make sure it's correctly
> cleaned up.
I see, got it.
>> So "forget" is indeed a bit of a misnomer, I was toying with other verbs
>> like "begone", "perish", "ban". But "forget" kind of nails it anyway :-)
> you could name it std::poison_name(). Or perhaps to avoid untoward
> connotations, std::disable_name().
>
> And no, that doesn't require including a header.
Good idea with a std:: prefix, avoids breaking someone's code that has a
type called "forget".
What about std::redact()?
Received on 2026-08-11 22:29:30
