C++ Logo


Advanced search

Re: "logical name" of importable headers

From: Gabriel Dos Reis <gdr_at_[hidden]>
Date: Fri, 3 Jun 2022 19:52:39 +0000
In the narrower context of C++ standard library headers:

Since the standards allow any C++ header (other that those inherited from C) to include any other C++ header, it follows that any C++ header can - in fact - include the entire standard library. Consequently, I suspect an implementation is permitted to replace #include of such standard headers with 'import std;' in C++23 and up

At this point, I don't know if MSVC will implement that but I believe it is a conforming implementation technique.

-- Gaby

-----Original Message-----
From: SG15 <sg15-bounces_at_[hidden]> On Behalf Of Daniel Ruoso via SG15
Sent: Friday, June 3, 2022 11:24 AM
To: sg15_at_[hidden]
Cc: Daniel Ruoso <daniel_at_[hidden]>
Subject: Re: [SG15] "logical name" of importable headers

Em sex., 3 de jun. de 2022 ās 13:55, Daniela Engert via SG15
<sg15_at_[hidden]> escreveu:
> On a tangent, what I really miss is metadata (possibly living besides the
> BMI) which is telling the compiler and build tools which header files a
> (named) module is replacing such that #include <lib/some/header.hpp>
> would be automatically translated into import lib;

That is interesting, but I don't know if the standard allows that. The
only thing the standard predicts is replacing `#include <foo.h>` by
`import <foo.h>`.

SG15 mailing list

Received on 2022-06-03 19:52:42