C++ Logo

std-proposals

Advanced search

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

From: Mital Ashok <mital_at_[hidden]>
Date: Wed, 12 Aug 2026 00:42:27 +0100
I can see a use case like:

// header file
namespace detail { // Or impl, internal, etc
  // ...
}
inline int api_function() {
    // Use detail::*
}
forget detail;

But this purpose (inline function needing internal helpers but not exposing
the helpers) can be achieved with modules

On Wed, 12 Aug 2026, 00:34 Ville Voutilainen via Std-Proposals, <
std-proposals_at_[hidden]> wrote:

> On Wed, 12 Aug 2026 at 01:41, Henry Skoglund <henry_at_[hidden]> wrote:
> > Perhaps I should make a new post with std::redact() as the new
> suggestion.
>
> That's a decent idea.
>
> > What do you think about redacting types, namespaces and functions? Is
> > that something to leave for a future exercise, i.e. for now you will
> > only be able to redact variables?
>
> It's less clear to me when and why one would want to redact the other
> cases, especially in narrower scopes.
> But I'm all for design exploration, and coverage of that exploration,
> so I can be convinced otherwise.
>
> It's your idea and proposal, after all, so feel free to exercise every
> corner of it. :)
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2026-08-11 23:42:47