undeclaring a variable is the same as relocating from a variable to nothingness (or to somewhere else).

 

A variable, which was relocated from, may also not be used any longer afterwards.

 

 

One detail may be the difference between position in the program (source code line within the block) and program flow.

 

int a = -1;

for (int i = 0; i < 10; i++) {

    if (i == 5)

        a++; // can a be used here?

    if (i == 4)

        undecl a;

    if (i == 5)

        a++; // and here?

}

 

-----Ursprüngliche Nachricht-----
Von: wjf via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: Mi 10.12.2025 02:23
Betreff: [std-proposals] [PXXXXR0] Add a New Keyword `undecl`
Anlage: Add_New_Keyword_undecl.pdf
An: std-proposals <std-proposals@lists.isocpp.org>;
CC: wjf <wjf@zenkee.cn>;
see attachment
 
wjf
wjf@zenkee.cn
 
-- 
 Std-Proposals mailing list
 Std-Proposals@lists.isocpp.org
 https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals