Description
[intro.compliance.general] paragraph 5:
A C++ translation unit ([lex.phases]) obtains access to the names defined in the library by including the appropriate standard library header or importing the appropriate standard library named header unit ([using.headers]).
The entities in the C++ standard library are defined in headers, whose contents are made available to a translation unit when it contains the appropriate
#include
preprocessing directive ([cpp.include]) or the appropriateimport
declaration ([module.import]).
Problems
I think the intent here is that [intro.compliance] acts as a forward reference which lists possible ways to get standard library names, but it fails to mention import std
([std.modules]), so it is incomplete.
It is also weird that [intro.compliance] specifically mentions named header units, but [using.headers], which it references, keeps it somewhat vague with "appropriate import
declaration". You would think that the [library] wording would contain more detailed wording, not less detailed.
Suggested solution
If we are keeping the paragraph in [intro.compliance], it should additionally mention [std.modules]. Furthermore,the wording in [using.headers] should mention "named header units" instead of "appropriate import
declaration", which is needlessly vague.
Activity
Eisenwave commentedon Apr 21, 2025
Another bit of redundancy is [intro.compliance.general] paragraph 6 and [using.linkage], both of which specify that entities in the C++ standard library have external linkage.