C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Translation-unit-local functions that access private class fields

From: Simon Schröder <dr.simon.schroeder_at_[hidden]>
Date: Sun, 26 Apr 2026 20:14:46 +0200
> On Apr 26, 2026, at 7:47 PM, André Offringa via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> - There is some mentioning that modules (at that time, 2013) could provide a better solution

Before we had modules everybody (probably not truly everybody because then we would have it) thought that modules would be solving these kinds of problems. Intuitively, one assumes that we compile a module and then we just need to #import that module and don’t need a header file or similar anymore. And the module file (now known as the BMI) would certainly not contain the private symbols.

However, this is not what we got with the current modules. We still need some of the source files for the module (I guess only the ones with the module exports). This, again, shows the implementation of your classes to the user of them. So, this point is moot and your proposal still valid.

Received on 2026-04-26 18:15:00