C++ Logo

std-proposals

Advanced search

Re: [std-proposals] A new C++ keyword: forget

From: Rainer Deyke <rainerd_at_[hidden]>
Date: Wed, 12 Aug 2026 13:43:53 +0200
On 8/12/26 09:51, David Brown via Std-Proposals wrote:
> 2. Allow declaring a variable of "void" type. Now "void a;" covers the
> OP's idea of "forget", since a variable of type "void" can't do much
> except have its address taken.

There's is no need to allow a void variable to have its address taken,
or to treat it as a real variable at all. Void is already a special
case in the C++ type system with special rules. This actually makes
grammatical sense in English if we treat "void" as a verb instead of a
noun. "void a;" voids the variable a.

I'm not a fan of this proposed feature at all, but at least re-using the
"void" keyword avoids introducing yet another keyword into the language.


-- 
Rainer Deyke - rainerd_at_[hidden]

Received on 2026-08-12 11:44:03