Date: Fri, 12 Dec 2025 21:58:26 +0100
One other option to implement something similar is to allow references to be reassigned.
{
int a = 1;
int b = 2;
int& c = a; // c points to a
using c = int& { b }; // or whatever syntax, c points to b
}
Advantage:
- clearer that lifetime is not affected
- some people expressed the wish for reassignment of references
Disadvantage:
- More variables necessary (the original variable and the reference)
- Some people expressed that references (compared to pointers) should never be reassignable
If you keep the type, a pointer solution is possible for this example.
-----Ursprüngliche Nachricht-----
Von:SD SH via Std-Proposals <std-proposals_at_[hidden]>
Gesendet:Fr 12.12.2025 20:44
Betreff:Re: [std-proposals] 回复: 回复: 回复: [PXXXXR0] Add a New Keyword ‘undecl’
An:std-proposals_at_[hidden];
CC:SD SH <Z5515zwy_at_[hidden]>;
You are right.
The usage I thought is using a new object instead of the original object, and tell compiler we don't use the current object anymore. It seems that we have different purpose on this feature.
As for the immediate closing, it is indeed unreasonable.
Follow your opinion, the feature might only unbind the object and identifier and then the identifier be released, right?
--
Std-Proposals mailing list
Std-Proposals_at_[hidden]
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2025-12-12 21:13:16
