C++ Logo

sg15

Advanced search

Re: P1905 In-Source Mechanism to Identify Importable Headers

From: Daniel Ruoso <daniel_at_[hidden]>
Date: Wed, 27 Jul 2022 08:36:08 -0400
On Wed, Jul 27, 2022, 05:50 Corentin via SG15 <sg15_at_[hidden]> wrote:

> I think it's something we ought to explore, if only for the sake of
> ahead-of-time scanning build systems.
>

I have gotten to the conclusion that it's actually a good thing that
importable headers are indistinguishable from the source code alone.

Essentially, from the build system perspective, an importable header needs
all the same semantics that named modules do, including the need for
additional metadata (such as preprocessor arguments) as well as the ability
to reuse BMI files.

For that reason, I think importable modules will always need to be
explicitly identified by the build system either when they're in the same
project, but even more when importable headers are shared with a pre-built
library.

IOW, just knowing that a header is importable is not sufficient, the same
way that just knowing that a module interface exists is not sufficient.

Daniel

Received on 2022-07-27 12:36:37