C++ Logo

sg15

Advanced search

Re: [isocpp-sg15] [isocpp-core] [modules] wordings to allow build system to not always emit BMI for implementation partition units

From: Richard Smith <richardsmith_at_[hidden]>
Date: Thu, 15 Jan 2026 18:05:09 -0800
If we're looking for a syntax for a module unit that doesn't implicitly
import the module interface (which is not on-topic for CWG, but since SG15
is also CC'd...) how about

explicit module M; // in module M but does not implicitly import M

On Thu, 15 Jan 2026 at 17:49, Chuanqi Xu via Core <core_at_[hidden]>
wrote:

> No... it will still introduce breaking change since now we may still
> import parition in implementation unit which is not a partition if the
> imported partition is an implementation partition.
>
> And from language perpsective, the users now can legally import any
> partition if they want. This is not banned. So the trival change (asking
> implementation unit don’t importing the primary module interface unit) will
> be a breaking change in my mind.
>
> Thanks,
> Chuanqi
>
> ------------------------------------------------------------------
> From:Jan Kokemüller <jan.kokemueller_at_[hidden]>
> Send Time:Thu, Jan 15, 2026, 19:53
> To:SG15<sg15_at_[hidden]>; core<core_at_[hidden]>
> CC:Chuanqi Xu<chuanqi.xcq_at_[hidden]>
> Subject:Re: [isocpp-sg15] [isocpp-core] [modules] wordings to allow build
> system to not always emit BMI for implementation partition units
>
> On 15.01.26 04:31, Chuanqi Xu via SG15 wrote:
> >> It seems to me that what you want is a module implementation unit that
> doesn't import the primary module interface unit.
> >
> > Yeah, exactly.
> >
> >> The evolution question is whether we want to add a way to express this
> use case without the throwaway partition name.
> >
> > I didn’t think this in the first time since I feel this is a breaking
> change. But, if we or the EWG feel good, maybe we can do this?
>
>
> What about the following (breaking) change to the standard:
>
> module B; // implicitly imports B as usual
>
> ...but:
>
> module B; // does _not_ implicitly import B
> import :Y; // ...because we explicitly import a partition
>
> Looking at the ecosystem we might just get away with this breaking
> change... What do you think?
>
> _______________________________________________
> Core mailing list
> Core_at_[hidden]
> Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/core
> Link to this post: http://lists.isocpp.org/core/2026/01/19227.php
>

Received on 2026-01-16 02:05:23