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: Bingzhi <bingzhi2025_at_[hidden]>
Date: Wed, 12 Aug 2026 13:45:48 +0800 (CST)
`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_projectalpha.org>
>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]
>

Received on 2026-08-12 05:46:03