C++ Logo

std-proposals

Advanced search

Re: [std-proposals] [PXXXXR0] Add a New Keyword `undecl`

From: Breno Guimarães <brenorg_at_[hidden]>
Date: Tue, 9 Dec 2025 22:35:13 -0300
The paper says that undecl can only be called in the same brace level as
the declaration. So I guess this example isn't valid.

Em ter., 9 de dez. de 2025, 22:29, Sebastian Wittmeier via Std-Proposals <
std-proposals_at_[hidden]> escreveu:

> 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_at_[hidden]>
> *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_at_[hidden]>;
> *CC:* wjf <wjf_at_[hidden]>;
> see attachment
>
> wjf
> wjf_at_[hidden]
>
> <https://wx.mail.qq.com/home/index?t=readmail_businesscard_midpage&nocheck=true&name=wjf&icon=http%3A%2F%2Fthirdqq.qlogo.cn%2Fek_qqapp%2FAQNPOicdlIgbG9Ribmfj8EKjTG2hwBlicwibL4stQmE6UNEQ3eh3aQCoFUzN0k1xGg%2F0&mail=wjf%40zenkee.cn&code=>
>
>
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2025-12-10 01:35:28