C++ Logo


Advanced search

Re: Questions about wording and design intention for header units and ideas

From: Daniel Ruoso <daniel_at_[hidden]>
Date: Tue, 23 May 2023 20:30:59 -0400
On Tue, May 23, 2023, 20:22 许传奇(夜灯) via SG15 <sg15_at_[hidden]> wrote:

> Now we can't assume `user.cpp` isn't the same with `user.orig.cpp`. It is
> surprising since such patterns are
> pretty common in practice. And I'm worrying that we'll meet problems if
> this is true.

It's actually worse than that. Since the compiler is free to replace
`#include` by the equivalent `import` the semantic change can happen even
without any source change in the code.

If someone declare the header to be importable, the semantics change

As I said before, so far, early experiences simply put the burden on the
user not to choose headers where this would be a problem.


Received on 2023-05-24 00:31:13