C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Sebastian Wittmeier Re: Extending the usage of final: trying to > make compiler optimize more aggressively and trying to make the > language have a proper way to represent customization point objects > (CPO). [was: Std-Proposals Digest,

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Wed, 12 Aug 2026 09:46:35 +0200
The post was the half-serious, half-funny (I should have marked) observation that there are proposals   to help with hacking: define automatic wrappers, extend a class with private functions which are not in the class definition, to override final functions, ...   And then there are the proposals to limit access, to drop variables, to redact functions, ...   Taken together it is a meta-fight about whether the author of a class has authority over it, or whether there are C++ features to override this authority, and any user of a class has final authority.   My joke was that for the exact new feature stopping some access, one or two standards later new a new feature is suggested to override this denial of access.   In some cases this gives nice flexibility, in others it totally contradicts the intent of the first feature and has to be forbidden in coding guidelines (or upcoming profiles) to keep any teeth, to stay in any way meaningful,   e.g. from const 'feature' a const_cast 'feature' follows, but is a red flag in any code review, if there is no good explanation to use it. (for the architecture, but can be even UB in some cases).   -----Ursprüngliche Nachricht----- Von:Bingzhi via Std-Proposals <std-proposals_at_[hidden]> Gesendet:Mi 12.08.2026 07:46 Betreff:Re: [std-proposals] Sebastian Wittmeier Re: Extending the usage of final: trying to >make compiler optimize more aggressively and trying to make the >language have a proper way to represent customization point objects >(CPO). [was: Std-Proposals Digest, An:std-proposals_at_[hidden]; CC:Bingzhi <bingzhi2025_at_[hidden]>; `overide ban`? Do you mean transitivity? Or, is there a reason to ban the ban of [overloads, specializations, derived classes, overrides] afterwards? It's wholly for optimizing compilation performance, not for safety or code constraints (that could be achieved via third-party static analyzers). If compiler knows early that a template only has those specializations/overloads and no more, it can optimize more aggressively, which might make a `final template <std::meta::info type> consteval bool compute()` even faster than its un-`finalized` variable template counterpart, with even more flexibility; you can just use if-constexpr and iterate over a result freely instead of using a bunch of concepts and requires just for reducing compilation time (in the cost of more brain cells or your colleagues' brain cells).   >Message: 4 >Date: Mon, 10 Aug 2026 18:19:00 +0200 >From: Sebastian Wittmeier <wittmeier_at_[hidden]> >To: std-proposals_at_[hidden] <std-proposals_at_[hidden]> >Subject: Re: [std-proposals] Extending the usage of final: trying to > make compiler optimize more aggressively and trying to make the > language have a proper way to represent customization point objects > (CPO). [was: Std-Proposals Digest, Vol 89, Issue 15] >Message-ID: > <zarafa.6a79f9f4.6e85.6f81ddd17532c953_at_lvps176-28-11-36.dedicated.hosteurope.> > >Content-Type: text/plain; charset="utf-8" > >:-) > >C++29: > >Proposal for feature to ban [overloads, specializations, derived classes, overrides] > >? >C++3x: > >Proposal for feature to override ban of [overloads, specializations, derived classes, overrides] > >for [customization, debugging, hacking, reviving old code, testing] > -- Std-Proposals mailing list Std-Proposals_at_[hidden] https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2026-08-12 07:52:11