Date: Thu, 30 Apr 2026 06:47:15 +0200
> On Apr 30, 2026, at 12:41 AM, Steve Weinrich via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> It seemed to me that what the OP wants is simply impossible because extending a class must require the classes permission. Either through access control or some new mechanism. A new mechanism must not permit access from everywhere!
I did this mistake sometime at the beginning of this discussion as well: There is some sort of permission control: some public function needs to call your private function directly or indirectly (i.e. through other protected/private functions). It does not matter if you add private functions if they cannot be called. So, yes anybody can add a private function anywhere in the source code. No, they can’t use it (without some weird tricks that might be possible even right now). The only place where this makes sense is in the implementation TU of the class. We need to at least declare the hidden private functions before they can be accessed by other member functions of the class.
>
> It seemed to me that what the OP wants is simply impossible because extending a class must require the classes permission. Either through access control or some new mechanism. A new mechanism must not permit access from everywhere!
I did this mistake sometime at the beginning of this discussion as well: There is some sort of permission control: some public function needs to call your private function directly or indirectly (i.e. through other protected/private functions). It does not matter if you add private functions if they cannot be called. So, yes anybody can add a private function anywhere in the source code. No, they can’t use it (without some weird tricks that might be possible even right now). The only place where this makes sense is in the implementation TU of the class. We need to at least declare the hidden private functions before they can be accessed by other member functions of the class.
Received on 2026-04-30 04:47:29
