Date: Sat, 23 May 2026 18:53:24 +0100
On Sat, 23 May 2026, 17:36 Marcin Jaczewski, <marcinjaczewski86_at_[hidden]>
wrote:
> sob., 23 maj 2026 o 12:08 Jonathan Wakely via Std-Proposals
> <std-proposals_at_[hidden]> napisaĆ(a):
> >
> >
> >
> > On Sat, 23 May 2026 at 00:38, Adrian Johnston via Std-Proposals <
> std-proposals_at_[hidden]> wrote:
> >>
> >>
> >> Personally, I would expect all the permutations of the standard library
> modules required to be provided by my compiler vender, e.g. Ubuntu.
> >
> >
> > No, that is very explicitly NOT how modules are expected to be used or
> deployed. GCC provides the std.cc file and you are expected to produce a
> CMI for your own needs.
> >
> > Otherwise there would be a ton of CMIs that need to be installed for
> every -std and other options that affect it, and the compiler would need to
> know where to find them based on the command-line options.
>
> Could one module provide multiple versions of std lib?
>
Without the __cplusplus macro there's no way to limit what the module
exports to only the features that match the -std you're compelling with.
A lot types could be binary compatible and do not need a lot of
> duplications.
> Otherwise how would shared std dynamic lib work?
>
The library contains all the symbols, but you can't create an executable
that depends on a C++23 symbol (such as string::contains) if you compile
your source code with -std=c++20, because the new features simply aren't
declared in the header and so aren't usable.
With a module that exports everything, you'd be able to use everything,
even with -std=c++20.
wrote:
> sob., 23 maj 2026 o 12:08 Jonathan Wakely via Std-Proposals
> <std-proposals_at_[hidden]> napisaĆ(a):
> >
> >
> >
> > On Sat, 23 May 2026 at 00:38, Adrian Johnston via Std-Proposals <
> std-proposals_at_[hidden]> wrote:
> >>
> >>
> >> Personally, I would expect all the permutations of the standard library
> modules required to be provided by my compiler vender, e.g. Ubuntu.
> >
> >
> > No, that is very explicitly NOT how modules are expected to be used or
> deployed. GCC provides the std.cc file and you are expected to produce a
> CMI for your own needs.
> >
> > Otherwise there would be a ton of CMIs that need to be installed for
> every -std and other options that affect it, and the compiler would need to
> know where to find them based on the command-line options.
>
> Could one module provide multiple versions of std lib?
>
Without the __cplusplus macro there's no way to limit what the module
exports to only the features that match the -std you're compelling with.
A lot types could be binary compatible and do not need a lot of
> duplications.
> Otherwise how would shared std dynamic lib work?
>
The library contains all the symbols, but you can't create an executable
that depends on a C++23 symbol (such as string::contains) if you compile
your source code with -std=c++20, because the new features simply aren't
declared in the header and so aren't usable.
With a module that exports everything, you'd be able to use everything,
even with -std=c++20.
Received on 2026-05-23 17:53:43
