C++ Logo

sg15

Advanced search

Re: "logical name" of importable headers

From: Daniela Engert <dani_at_[hidden]>
Date: Fri, 3 Jun 2022 22:18:34 +0200
Am 03.06.2022 um 21:52 schrieb Gabriel Dos Reis via SG15:
> 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
I agree, that naturally follows from connecting the dots. Hence my
desire for having such a facility available not only for the standard
library but for similarily structured named modules as well.
> At this point, I don't know if MSVC will implement that but I believe it is a conforming implementation technique.

I really hope that this will become reality. Having that would be a huge
win for the community at large: every #include of a standard library
header would be synonymous to import std; 😊 And every source would gain
by taking advantage of a modularized standard library without having to
change anything and transitioning to import std; could become a non-brainer.

Ciao
   Dani

>
> -- 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
> _______________________________________________
> SG15 mailing list
> SG15_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/sg15


-- 
PGP/GPG: 2CCB 3ECB 0954 5CD3 B0DB 6AA0 BA03 56A1 2C4638C5

Received on 2022-06-03 20:18:36