C++ Logo

sg15

Advanced search

Re: unimported implementation partitions

From: Daniela Engert <dani_at_[hidden]>
Date: Thu, 9 Jun 2022 10:31:07 +0200
Am 09.06.2022 um 09:55 schrieb Boris Kolpackov via SG15:
> Gabriel Dos Reis via SG15 <sg15_at_[hidden]> writes:
>
>> How would a program observe that an implementation partition isn't
>> imported but is relevant to the behavior of the entire program?
> The implementation partition can register itself (as part of the
> static initialization) in some registry.
>
> For example, the implementation partition may include a unit test
> (because that's the only way to access the private parts) which
> is registered with the test harness.

The standard is totally silent about module partitions [module.unit]/3
that are also module implementation units [module.unit]/2, and which are
not required to be reachable [module.reach]/2 because they are not part
of the interface dependency [module.import]/10 graph of a module. They
may or may not have semantic effects.

If you want the behaviour from your example be portable you need to form
an interface dependency to that partition.

Received on 2022-06-09 08:31:25