As far as I understood, forget is with source code lines in the scope.

 

while (int a = 4; true) {

   a; // always valid

   if (b)

     forget a; // invalid or no effect in while loop

   forget a;

   a; // invalid, but only for this iteration


 

-----Ursprüngliche Nachricht-----
Von: Ville Voutilainen via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: Mi 12.08.2026 16:04
Betreff: Re: [std-proposals] A new C++ keyword: forget
An: std-proposals@lists.isocpp.org;
CC: Ville Voutilainen <ville.voutilainen@gmail.com>; Udo Steinbach <usenet@udoline.de>;
On Wed, 12 Aug 2026 at 16:52, Udo Steinbach via Std-Proposals
<std-proposals@lists.isocpp.org> wrote:
>
> Again: Benefit?
> I don't see an answer on the most important question.

Three relatively-concrete use cases come to mind:
1) poisoning a variable after it's been moved from
2) poisoning a task graph after it's been launched (which in Senders
is also a move, but elsewhere might not be)
3) poisoning a task completion after its result has been received
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals