C++ Logo

sg15

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>`.

daniel
_______________________________________________
SG15 mailing list
SG15_at_[hidden]
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.isocpp.org%2Fmailman%2Flistinfo.cgi%2Fsg15&amp;data=05%7C01%7Cgdr%40microsoft.com%7C1693f89859064471778d08da458e4fb5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637898774770481644%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=T%2FxYnBR31AE3PEKTeyO8atB4Q0nUWn6qJ01h7P6sC0E%3D&amp;reserved=0

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