Date: Wed, 12 Aug 2026 09:49:55 +0200
There is no optimization potential for overload resolution. At compile time
the compiler looks at all visible overloads, picks one of these and puts
the exact call into the generated code. It's basically the same with
templates. At compile time the set of overloads or templates is "final".
And compilers don't have any smart caches between compilation runs. It
would also not help as the 'final' keyword can be removed any time by the
programmer.
So, the 'final' keyword would only restrict the programmer, but does not
help the compiler.
On Wed, Aug 12, 2026 at 7:46 AM Bingzhi via Std-Proposals <
std-proposals_at_[hidden]> wrote:
> `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
>
the compiler looks at all visible overloads, picks one of these and puts
the exact call into the generated code. It's basically the same with
templates. At compile time the set of overloads or templates is "final".
And compilers don't have any smart caches between compilation runs. It
would also not help as the 'final' keyword can be removed any time by the
programmer.
So, the 'final' keyword would only restrict the programmer, but does not
help the compiler.
On Wed, Aug 12, 2026 at 7:46 AM Bingzhi via Std-Proposals <
std-proposals_at_[hidden]> wrote:
> `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:50:38
