C++ Features Banned By Google
Gregor Mückl
gregormueckl at gmx.de
Tue Jan 27 20:22:12 UTC 2026
On Saturday, 24 January 2026 at 17:39:21 UTC, H. S. Teoh wrote:
> On Sat, Jan 24, 2026 at 09:29:06AM -0800, Walter Bright via
> Digitalmars-d wrote:
>> On 1/23/2026 3:58 PM, H. S. Teoh wrote:
>> > Rationale seems to be inadequate support in Clang and GN
>> > (sic - what's GN?), not that modules themselves are bad.
>>
>> My suspicion is that it's unusually difficult to implement. It
>> requires precompiled files to be written out - my experience
>> with that (precompiled headers) is it is overly complex.
>
> Possibly. I'm not familiar with C++ modules: what exactly does
> it entail? You have to precompile headers before they can be
> used as a module? That sounds unusually onerous, compared to,
> say, D, where the compiler just parses the source file directly
> and the user doesn't have to do anything extra.
>
>
> T
I'm not too familiar with modules, but the C++ modules really
have a level of complexity that is staggering to my mind. It's
not that one file is one module (1:1). That would have been too
easy ;).
Instead, you can separate modules out over several files (module
partitions). They form the same module by virtue of having the
same name in their module statements. But not all partitions are
equal, either. Some are interfaces (their content is visible
externally), some internal (their content is only visible
internally).
Of course, all of this still interacts somehow with header files
and preprocessor macros.
AFAIK the standard assumes that modules are compiled into some
kind of self-contained artifacts that can then be imported by
other modules without a need for separate header files. So in my
understanding, a compiler has to work with some kind of superset
of precompiled headers and object files.
More information about the Digitalmars-d
mailing list