Topic: Modules and #include


Author: "FrankHB" <frankhb1989@gmail.com>
Date: Sun, 6 Dec 2015 17:56:38 +0800
Raw View
This is a multipart message in MIME format.

------=_NextPart_000_001E_01D1304F.7633F040
Content-Type: text/plain; charset=UTF-8

Recently I noticed that:

* A header is not required as a "source file".
* In [cpp.include]/2, "How the places are specified or the header
identified is implementation-defined."

For an implementation, is it possible to provide a module system based on
extending these rules? For example:

#include <cpp-module://std.iostream>

Or even:

#define STD_MODULES(name)
<http://www.open-std.org/JTC1/SC22/WG21/?modules=##name##>
#include STD_MODULES(std.iostream)

And have the committee thought about the possibility like that?



--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_NextPart_000_001E_01D1304F.7633F040
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV=3D"Content-Type" CONTENT=
=3D"text/html; charset=3Dus-ascii"><meta name=3DGenerator content=3D"Micros=
oft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
 {font-family:Wingdings;
 panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
 {font-family:\5B8B\4F53;
 panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
 {font-family:"Cambria Math";
 panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
 {font-family:\7B49\7EBF;
 panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
 {font-family:"\@\5B8B\4F53";
 panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
 {font-family:"\@\7B49\7EBF";
 panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
 {margin:0cm;
 margin-bottom:.0001pt;
 text-align:justify;
 text-justify:inter-ideograph;
 font-size:10.5pt;
 font-family:\7B49\7EBF;}
a:link, span.MsoHyperlink
 {mso-style-priority:99;
 color:#0563C1;
 text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
 {mso-style-priority:99;
 color:#954F72;
 text-decoration:underline;}
p
 {mso-style-priority:99;
 mso-margin-top-alt:auto;
 margin-right:0cm;
 mso-margin-bottom-alt:auto;
 margin-left:0cm;
 font-size:12.0pt;
 font-family:\5B8B\4F53;}
span.EmailStyle17
 {mso-style-type:personal-compose;
 font-family:\7B49\7EBF;
 color:windowtext;}
span.styled-by-prettify
 {mso-style-name:styled-by-prettify;}
..MsoChpDefault
 {mso-style-type:export-only;
 font-family:\7B49\7EBF;}
/* Page Definitions */
@page WordSection1
 {size:612.0pt 792.0pt;
 margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
 {page:WordSection1;}
/* List Definitions */
@list l0
 {mso-list-id:1255821920;
 mso-list-template-ids:-758197814;}
@list l0:level1
 {mso-level-number-format:bullet;
 mso-level-text:\F0B7;
 mso-level-tab-stop:36.0pt;
 mso-level-number-position:left;
 text-indent:-18.0pt;
 mso-ansi-font-size:10.0pt;
 font-family:Symbol;}
@list l0:level2
 {mso-level-number-format:bullet;
 mso-level-text:o;
 mso-level-tab-stop:72.0pt;
 mso-level-number-position:left;
 text-indent:-18.0pt;
 mso-ansi-font-size:10.0pt;
 font-family:"Courier New";
 mso-bidi-font-family:"Times New Roman";}
@list l0:level3
 {mso-level-number-format:bullet;
 mso-level-text:\F0A7;
 mso-level-tab-stop:108.0pt;
 mso-level-number-position:left;
 text-indent:-18.0pt;
 mso-ansi-font-size:10.0pt;
 font-family:Wingdings;}
@list l0:level4
 {mso-level-number-format:bullet;
 mso-level-text:\F0A7;
 mso-level-tab-stop:144.0pt;
 mso-level-number-position:left;
 text-indent:-18.0pt;
 mso-ansi-font-size:10.0pt;
 font-family:Wingdings;}
@list l0:level5
 {mso-level-number-format:bullet;
 mso-level-text:\F0A7;
 mso-level-tab-stop:180.0pt;
 mso-level-number-position:left;
 text-indent:-18.0pt;
 mso-ansi-font-size:10.0pt;
 font-family:Wingdings;}
@list l0:level6
 {mso-level-number-format:bullet;
 mso-level-text:\F0A7;
 mso-level-tab-stop:216.0pt;
 mso-level-number-position:left;
 text-indent:-18.0pt;
 mso-ansi-font-size:10.0pt;
 font-family:Wingdings;}
@list l0:level7
 {mso-level-number-format:bullet;
 mso-level-text:\F0A7;
 mso-level-tab-stop:252.0pt;
 mso-level-number-position:left;
 text-indent:-18.0pt;
 mso-ansi-font-size:10.0pt;
 font-family:Wingdings;}
@list l0:level8
 {mso-level-number-format:bullet;
 mso-level-text:\F0A7;
 mso-level-tab-stop:288.0pt;
 mso-level-number-position:left;
 text-indent:-18.0pt;
 mso-ansi-font-size:10.0pt;
 font-family:Wingdings;}
@list l0:level9
 {mso-level-number-format:bullet;
 mso-level-text:\F0A7;
 mso-level-tab-stop:324.0pt;
 mso-level-number-position:left;
 text-indent:-18.0pt;
 mso-ansi-font-size:10.0pt;
 font-family:Wingdings;}
ol
 {margin-bottom:0cm;}
ul
 {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DZH-CN link=3D"#0563C1=
" vlink=3D"#954F72" style=3D'text-justify-trim:punctuation'><div class=3DWo=
rdSection1><p class=3DMsoNormal align=3Dleft style=3D'text-align:left'><spa=
n lang=3DEN-US style=3D'font-size:12.0pt;font-family:&#23435;&#20307;'>Rece=
ntly I noticed that:<o:p></o:p></span></p><ul type=3Ddisc><li class=3DMsoNo=
rmal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align=
:left;mso-list:l0 level1 lfo1'><span lang=3DEN-US style=3D'font-size:12.0pt=
;font-family:&#23435;&#20307;'>A header is not required as a &quot;source f=
ile&quot;.<o:p></o:p></span></li><li class=3DMsoNormal style=3D'mso-margin-=
top-alt:auto;mso-margin-bottom-alt:auto;text-align:left;mso-list:l0 level1 =
lfo1'><span lang=3DEN-US style=3D'font-size:12.0pt;font-family:&#23435;&#20=
307;'>In [cpp.include]/2, &quot;How the places are specified or the header =
identified is implementation-defined.&quot;<o:p></o:p></span></li></ul><p c=
lass=3DMsoNormal align=3Dleft style=3D'mso-margin-top-alt:auto;mso-margin-b=
ottom-alt:auto;text-align:left'><span lang=3DEN-US style=3D'font-size:12.0p=
t;font-family:&#23435;&#20307;'>For an implementation, is it possible to pr=
ovide a module system based on extending these rules? For example:<o:p></o:=
p></span></p><p class=3DMsoNormal align=3Dleft style=3D'text-align:left;bac=
kground:#FAFAFA'><span lang=3DEN-US style=3D'font-size:12.0pt;font-family:&=
#23435;&#20307;;color:#880000'>#include</span><span lang=3DEN-US style=3D'f=
ont-size:12.0pt;font-family:&#23435;&#20307;;color:black'> </span><span lan=
g=3DEN-US style=3D'font-size:12.0pt;font-family:&#23435;&#20307;;color:#666=
600'>&lt;</span><span lang=3DEN-US style=3D'font-size:12.0pt;font-family:&#=
23435;&#20307;;color:black'>cpp</span><span lang=3DEN-US style=3D'font-size=
:12.0pt;font-family:&#23435;&#20307;;color:#666600'>-</span><span lang=3DEN=
-US style=3D'font-size:12.0pt;font-family:&#23435;&#20307;;color:#000088'>m=
odule</span><span lang=3DEN-US style=3D'font-size:12.0pt;font-family:&#2343=
5;&#20307;;color:#666600'>:</span><span lang=3DEN-US style=3D'font-size:12.=
0pt;font-family:&#23435;&#20307;;color:#880000'>//std.iostream&gt;</span><s=
pan lang=3DEN-US style=3D'font-size:12.0pt;font-family:&#23435;&#20307;'><o=
:p></o:p></span></p><p class=3DMsoNormal align=3Dleft style=3D'text-align:l=
eft'><span lang=3DEN-US style=3D'font-size:12.0pt;font-family:&#23435;&#203=
07;'>Or even:<o:p></o:p></span></p><p class=3DMsoNormal align=3Dleft style=
=3D'text-align:left;background:#FAFAFA'><span lang=3DEN-US style=3D'font-si=
ze:12.0pt;font-family:&#23435;&#20307;;color:#880000'>#define</span><span l=
ang=3DEN-US style=3D'font-size:12.0pt;font-family:&#23435;&#20307;;color:bl=
ack'> STD_MODULES</span><span lang=3DEN-US style=3D'font-size:12.0pt;font-f=
amily:&#23435;&#20307;;color:#666600'>(</span><span lang=3DEN-US style=3D'f=
ont-size:12.0pt;font-family:&#23435;&#20307;;color:black'>name</span><span =
lang=3DEN-US style=3D'font-size:12.0pt;font-family:&#23435;&#20307;;color:#=
666600'>)</span><span lang=3DEN-US style=3D'font-size:12.0pt;font-family:&#=
23435;&#20307;;color:black'> </span><span lang=3DEN-US style=3D'font-size:1=
2.0pt;font-family:&#23435;&#20307;;color:#666600'>&lt;</span><span lang=3DE=
N-US style=3D'font-size:12.0pt;font-family:&#23435;&#20307;;color:black'>ht=
tp</span><span lang=3DEN-US style=3D'font-size:12.0pt;font-family:&#23435;&=
#20307;;color:#666600'>:</span><span lang=3DEN-US style=3D'font-size:12.0pt=
;font-family:&#23435;&#20307;;color:#880000'>//www.open-std.org/JTC1/SC22/W=
G21/?modules=3D##name##&gt;</span><span lang=3DEN-US style=3D'font-size:12.=
0pt;font-family:&#23435;&#20307;;color:black'><br></span><span lang=3DEN-US=
 style=3D'font-size:12.0pt;font-family:&#23435;&#20307;;color:#880000'>#inc=
lude</span><span lang=3DEN-US style=3D'font-size:12.0pt;font-family:&#23435=
;&#20307;;color:black'> STD_MODULES</span><span lang=3DEN-US style=3D'font-=
size:12.0pt;font-family:&#23435;&#20307;;color:#666600'>(</span><span lang=
=3DEN-US style=3D'font-size:12.0pt;font-family:&#23435;&#20307;;color:black=
'>std.iostream</span><span lang=3DEN-US style=3D'font-size:12.0pt;font-fami=
ly:&#23435;&#20307;;color:#666600'>)</span><span lang=3DEN-US style=3D'font=
-size:12.0pt;font-family:&#23435;&#20307;'><o:p></o:p></span></p><p class=
=3DMsoNormal align=3Dleft style=3D'mso-margin-top-alt:auto;margin-bottom:12=
..0pt;text-align:left'><span lang=3DEN-US style=3D'font-size:12.0pt;font-fam=
ily:&#23435;&#20307;'>And have the committee thought about the possibility =
like that?<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US><o:=
p>&nbsp;</o:p></span></p></div></body></html>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_NextPart_000_001E_01D1304F.7633F040--


.


Author: Nicol Bolas <jmckesson@gmail.com>
Date: Sun, 6 Dec 2015 06:54:45 -0800 (PST)
Raw View
------=_Part_279_1934850990.1449413685832
Content-Type: multipart/alternative;
 boundary="----=_Part_280_834283387.1449413685832"

------=_Part_280_834283387.1449413685832
Content-Type: text/plain; charset=UTF-8

Wouldn't it be much easier for implementers to just have a header file that
contains an import directive plus whatever macros have to be included?

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_280_834283387.1449413685832
Content-Type: text/html; charset=UTF-8

<div dir="ltr">Wouldn&#39;t it be much easier for implementers to just have a header file that contains an import directive plus whatever macros have to be included?</div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:std-proposals+unsubscribe@isocpp.org">std-proposals+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href="mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href="http://groups.google.com/a/isocpp.org/group/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/</a>.<br />

------=_Part_280_834283387.1449413685832--
------=_Part_279_1934850990.1449413685832--

.


Author: FrankHB1989 <frankhb1989@gmail.com>
Date: Sun, 6 Dec 2015 19:23:29 -0800 (PST)
Raw View
------=_Part_4492_812230061.1449458609897
Content-Type: multipart/alternative;
 boundary="----=_Part_4493_1377653185.1449458609902"

------=_Part_4493_1377653185.1449458609902
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



=E5=9C=A8 2015=E5=B9=B412=E6=9C=886=E6=97=A5=E6=98=9F=E6=9C=9F=E6=97=A5 UTC=
+8=E4=B8=8B=E5=8D=8810:54:46=EF=BC=8CNicol Bolas=E5=86=99=E9=81=93=EF=BC=9A
>
> Wouldn't it be much easier for implementers to just have a header file=20
> that contains an import directive plus whatever macros have to be include=
d?
>

I don't think so.

There are implementations support targetting different edition of the=20
standards. Of course they can reimplement #include, but there is more work=
=20
on testing. On the other hand, specify extensions on #include has little=20
impact on both current standards and implementations. Implementers can=20
still do what they like to for more specified features, including the=20
current work on module. Even if modules have been implemented widely, this=
=20
method is still interesting for project management (e.g. versioning).


--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_4493_1377653185.1449458609902
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>=E5=9C=A8 2015=E5=B9=B412=E6=9C=886=E6=97=A5=E6=98=
=9F=E6=9C=9F=E6=97=A5 UTC+8=E4=B8=8B=E5=8D=8810:54:46=EF=BC=8CNicol Bolas=
=E5=86=99=E9=81=93=EF=BC=9A<blockquote class=3D"gmail_quote" style=3D"margi=
n: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><di=
v dir=3D"ltr">Wouldn&#39;t it be much easier for implementers to just have =
a header file that contains an import directive plus whatever macros have t=
o be included?</div></blockquote><div><br>I don&#39;t think so.<br><br>Ther=
e are implementations support targetting different edition of the standards=
.. Of course they can reimplement #include, but there is more work on testin=
g. On the other hand, specify extensions on #include has little impact on b=
oth current standards and implementations. Implementers can still do what t=
hey like to for more specified features, including the current work on modu=
le. Even if modules have been implemented widely, this method is still inte=
resting for project management (e.g. versioning).<br><br><br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_4493_1377653185.1449458609902--
------=_Part_4492_812230061.1449458609897--

.


Author: Nicol Bolas <jmckesson@gmail.com>
Date: Mon, 7 Dec 2015 05:58:54 -0800 (PST)
Raw View
------=_Part_1247_1873085057.1449496734772
Content-Type: multipart/alternative;
 boundary="----=_Part_1248_1107776888.1449496734773"

------=_Part_1248_1107776888.1449496734773
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



On Sunday, December 6, 2015 at 10:23:30 PM UTC-5, FrankHB1989 wrote:
>
>
>
> =E5=9C=A8 2015=E5=B9=B412=E6=9C=886=E6=97=A5=E6=98=9F=E6=9C=9F=E6=97=A5 U=
TC+8=E4=B8=8B=E5=8D=8810:54:46=EF=BC=8CNicol Bolas=E5=86=99=E9=81=93=EF=BC=
=9A
>>
>> Wouldn't it be much easier for implementers to just have a header file=
=20
>> that contains an import directive plus whatever macros have to be includ=
ed?
>>
>
> I don't think so.
>
> There are implementations support targetting different edition of the=20
> standards.
>

Then you #ifdef around which module the header imports:

#if CPP_9803
import std.vector.98_03
#elseif CPP11
import std.vector.11
#elseif CPP14
import std.vector.14
#else
import std.vector.17
#endif

These defines would generally be specified on the command line.

This also allows you to have headers that provide macros while getting your=
=20
non-macro interfaces from modules.

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_1248_1107776888.1449496734773
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Sunday, December 6, 2015 at 10:23:30 PM UTC-5, =
FrankHB1989 wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"=
ltr"><br><br>=E5=9C=A8 2015=E5=B9=B412=E6=9C=886=E6=97=A5=E6=98=9F=E6=9C=9F=
=E6=97=A5 UTC+8=E4=B8=8B=E5=8D=8810:54:46=EF=BC=8CNicol Bolas=E5=86=99=E9=
=81=93=EF=BC=9A<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-l=
eft:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Wou=
ldn&#39;t it be much easier for implementers to just have a header file tha=
t contains an import directive plus whatever macros have to be included?</d=
iv></blockquote><div><br>I don&#39;t think so.<br><br>There are implementat=
ions support targetting different edition of the standards.</div></div></bl=
ockquote><div><br>Then you #ifdef around which module the header imports:<b=
r><br><div class=3D"prettyprint" style=3D"background-color: rgb(250, 250, 2=
50); border-color: rgb(187, 187, 187); border-style: solid; border-width: 1=
px; word-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"subpr=
ettyprint"><span style=3D"color: #800;" class=3D"styled-by-prettify">#if CP=
P_9803</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
</span><span style=3D"color: #008;" class=3D"styled-by-prettify">import</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> std</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">.</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">vector</span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">.</span><span style=3D"color: #0=
66;" class=3D"styled-by-prettify">98</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify">_03<br></span><span style=3D"color: #800;" class=
=3D"styled-by-prettify">#elseif CPP11</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" class=3D=
"styled-by-prettify">import</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> std</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">.</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
">vector</span><span style=3D"color: #660;" class=3D"styled-by-prettify">.<=
/span><span style=3D"color: #066;" class=3D"styled-by-prettify">11</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span st=
yle=3D"color: #800;" class=3D"styled-by-prettify">#elseif CPP14</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">import</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> std</span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">.</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify">vector</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">.</span><span style=3D"color: #066;" class=3D"style=
d-by-prettify">14</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"><br></span><span style=3D"color: #800;" class=3D"styled-by-prettify"=
>#else</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
</span><span style=3D"color: #008;" class=3D"styled-by-prettify">import</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> std</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">.</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">vector</span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">.</span><span style=3D"color: #0=
66;" class=3D"styled-by-prettify">17</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"><br></span><span style=3D"color: #800;" class=3D"=
styled-by-prettify">#endif</span></div></code></div><br>These defines would=
 generally be specified on the command line.<br><br>This also allows you to=
 have headers that provide macros while getting your non-macro interfaces f=
rom modules.<br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_1248_1107776888.1449496734773--
------=_Part_1247_1873085057.1449496734772--

.


Author: FrankHB1989 <frankhb1989@gmail.com>
Date: Mon, 7 Dec 2015 19:01:52 -0800 (PST)
Raw View
------=_Part_5733_1807768674.1449543712212
Content-Type: multipart/alternative;
 boundary="----=_Part_5734_2038015934.1449543712212"

------=_Part_5734_2038015934.1449543712212
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



=E5=9C=A8 2015=E5=B9=B412=E6=9C=887=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=80 UTC=
+8=E4=B8=8B=E5=8D=889:58:55=EF=BC=8CNicol Bolas=E5=86=99=E9=81=93=EF=BC=9A
>
>
>
> On Sunday, December 6, 2015 at 10:23:30 PM UTC-5, FrankHB1989 wrote:
>>
>>
>>
>> =E5=9C=A8 2015=E5=B9=B412=E6=9C=886=E6=97=A5=E6=98=9F=E6=9C=9F=E6=97=A5 =
UTC+8=E4=B8=8B=E5=8D=8810:54:46=EF=BC=8CNicol Bolas=E5=86=99=E9=81=93=EF=BC=
=9A
>>>
>>> Wouldn't it be much easier for implementers to just have a header file=
=20
>>> that contains an import directive plus whatever macros have to be inclu=
ded?
>>>
>>
>> I don't think so.
>>
>> There are implementations support targetting different edition of the=20
>> standards.
>>
>
> Then you #ifdef around which module the header imports:
>
> #if CPP_9803
> import std.vector.98_03
> #elseif CPP11
> import std.vector.11
> #elseif CPP14
> import std.vector.14
> #else
> import std.vector.17
> #endif
>
> These defines would generally be specified on the command line.
>
Does it mean many source files should be modified like this, or just better=
=20
allow different styles coexist in the library source?=20

> =20
>
This also allows you to have headers that provide macros while getting your=
=20
> non-macro interfaces from modules.
>

I see. It is hard for #include to solve macro pollution without change some=
=20
other preprocessing rules. Modules cannot wait them to be completed.

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_5734_2038015934.1449543712212
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><br>=E5=9C=A8 2015=E5=B9=B412=E6=9C=887=E6=97=A5=E6=98=9F=E6=9C=9F=E4=
=B8=80 UTC+8=E4=B8=8B=E5=8D=889:58:55=EF=BC=8CNicol Bolas=E5=86=99=E9=81=93=
=EF=BC=9A<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: =
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><br>=
<br>On Sunday, December 6, 2015 at 10:23:30 PM UTC-5, FrankHB1989 wrote:<bl=
ockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-l=
eft:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><br>=E5=9C=A8 201=
5=E5=B9=B412=E6=9C=886=E6=97=A5=E6=98=9F=E6=9C=9F=E6=97=A5 UTC+8=E4=B8=8B=
=E5=8D=8810:54:46=EF=BC=8CNicol Bolas=E5=86=99=E9=81=93=EF=BC=9A<blockquote=
 class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px =
#ccc solid;padding-left:1ex"><div dir=3D"ltr">Wouldn&#39;t it be much easie=
r for implementers to just have a header file that contains an import direc=
tive plus whatever macros have to be included?</div></blockquote><div><br>I=
 don&#39;t think so.<br><br>There are implementations support targetting di=
fferent edition of the standards.</div></div></blockquote><div><br>Then you=
 #ifdef around which module the header imports:<br><br><div style=3D"backgr=
ound-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:soli=
d;border-width:1px;word-wrap:break-word"><code><div><span style=3D"color:#8=
00">#if CPP_9803</span><span style=3D"color:#000"><br></span><span style=3D=
"color:#008">import</span><span style=3D"color:#000"> std</span><span style=
=3D"color:#660">.</span><span style=3D"color:#000">vector</span><span style=
=3D"color:#660">.</span><span style=3D"color:#066">98</span><span style=3D"=
color:#000">_03<br></span><span style=3D"color:#800">#elseif CPP11</span><s=
pan style=3D"color:#000"><br></span><span style=3D"color:#008">import</span=
><span style=3D"color:#000"> std</span><span style=3D"color:#660">.</span><=
span style=3D"color:#000">vector</span><span style=3D"color:#660">.</span><=
span style=3D"color:#066">11</span><span style=3D"color:#000"><br></span><s=
pan style=3D"color:#800">#elseif CPP14</span><span style=3D"color:#000"><br=
></span><span style=3D"color:#008">import</span><span style=3D"color:#000">=
 std</span><span style=3D"color:#660">.</span><span style=3D"color:#000">ve=
ctor</span><span style=3D"color:#660">.</span><span style=3D"color:#066">14=
</span><span style=3D"color:#000"><br></span><span style=3D"color:#800">#el=
se</span><span style=3D"color:#000"><br></span><span style=3D"color:#008">i=
mport</span><span style=3D"color:#000"> std</span><span style=3D"color:#660=
">.</span><span style=3D"color:#000">vector</span><span style=3D"color:#660=
">.</span><span style=3D"color:#066">17</span><span style=3D"color:#000"><b=
r></span><span style=3D"color:#800">#endif</span></div></code></div><br></d=
iv></div></blockquote><div></div><blockquote class=3D"gmail_quote" style=3D=
"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex=
;"><div dir=3D"ltr"><div>These defines would generally be specified on the =
command line.<br></div></div></blockquote><div>Does it mean many source fil=
es should be modified like this, or just better allow different styles coex=
ist in the library source? <br></div><blockquote class=3D"gmail_quote" styl=
e=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left:=
 1ex;"><div dir=3D"ltr"><div>=C2=A0</div></div></blockquote><blockquote cla=
ss=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #=
ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div>This also allows you to=
 have headers that provide macros while getting your non-macro interfaces f=
rom modules.<br></div></div></blockquote><div><br>I see. It is hard for #in=
clude to solve macro pollution without change some other preprocessing rule=
s. Modules cannot wait them to be completed.<br></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_5734_2038015934.1449543712212--
------=_Part_5733_1807768674.1449543712212--

.


Author: Nicol Bolas <jmckesson@gmail.com>
Date: Tue, 8 Dec 2015 06:02:52 -0800 (PST)
Raw View
------=_Part_236_389785199.1449583372669
Content-Type: multipart/alternative;
 boundary="----=_Part_237_991806680.1449583372669"

------=_Part_237_991806680.1449583372669
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



On Monday, December 7, 2015 at 10:01:52 PM UTC-5, FrankHB1989 wrote:
>
>
>
> =E5=9C=A8 2015=E5=B9=B412=E6=9C=887=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=80 U=
TC+8=E4=B8=8B=E5=8D=889:58:55=EF=BC=8CNicol Bolas=E5=86=99=E9=81=93=EF=BC=
=9A
>>
>>
>>
>> On Sunday, December 6, 2015 at 10:23:30 PM UTC-5, FrankHB1989 wrote:
>>>
>>>
>>>
>>> =E5=9C=A8 2015=E5=B9=B412=E6=9C=886=E6=97=A5=E6=98=9F=E6=9C=9F=E6=97=A5=
 UTC+8=E4=B8=8B=E5=8D=8810:54:46=EF=BC=8CNicol Bolas=E5=86=99=E9=81=93=EF=
=BC=9A
>>>>
>>>> Wouldn't it be much easier for implementers to just have a header file=
=20
>>>> that contains an import directive plus whatever macros have to be incl=
uded?
>>>>
>>>
>>> I don't think so.
>>>
>>> There are implementations support targetting different edition of the=
=20
>>> standards.
>>>
>>
>> Then you #ifdef around which module the header imports:
>>
>> #if CPP_9803
>> import std.vector.98_03
>> #elseif CPP11
>> import std.vector.11
>> #elseif CPP14
>> import std.vector.14
>> #else
>> import std.vector.17
>> #endif
>>
>> These defines would generally be specified on the command line.
>>
> Does it mean many source files should be modified like this, or just=20
> better allow different styles coexist in the library source?=20
>

This is merely a solution to the issue of versioning that you raised. If=20
you have different versions of a module that you want to deliver based on=
=20
some macro, this would be an adequate solution to that.

Personally, I would avoid having different versions of the same module=20
delivered based on a macro. But if that's not possible for you, this is one=
=20
alternative solution.

Another would be to build the module as part of the build system, and have=
=20
the macro be a command-line thing. That way, the specific standard library=
=20
module that they use would be built for each user as needed, based on their=
=20
command-line #define parameters.

This means that all code must be compiled under the same parameters, but=20
that is the way it always was, thanks to ODR.

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_237_991806680.1449583372669
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><br>On Monday, December 7, 2015 at 10:01:52 PM UTC-5, FrankHB1989 wrote=
:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bo=
rder-left: 1px #ccc solid;padding-left: 1ex;"><br><br>=E5=9C=A8 2015=E5=B9=
=B412=E6=9C=887=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=80 UTC+8=E4=B8=8B=E5=8D=88=
9:58:55=EF=BC=8CNicol Bolas=E5=86=99=E9=81=93=EF=BC=9A<blockquote class=3D"=
gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid=
;padding-left:1ex"><div dir=3D"ltr"><br><br>On Sunday, December 6, 2015 at =
10:23:30 PM UTC-5, FrankHB1989 wrote:<blockquote class=3D"gmail_quote" styl=
e=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex=
"><div dir=3D"ltr"><br><br>=E5=9C=A8 2015=E5=B9=B412=E6=9C=886=E6=97=A5=E6=
=98=9F=E6=9C=9F=E6=97=A5 UTC+8=E4=B8=8B=E5=8D=8810:54:46=EF=BC=8CNicol Bola=
s=E5=86=99=E9=81=93=EF=BC=9A<blockquote class=3D"gmail_quote" style=3D"marg=
in:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div di=
r=3D"ltr">Wouldn&#39;t it be much easier for implementers to just have a he=
ader file that contains an import directive plus whatever macros have to be=
 included?</div></blockquote><div><br>I don&#39;t think so.<br><br>There ar=
e implementations support targetting different edition of the standards.</d=
iv></div></blockquote><div><br>Then you #ifdef around which module the head=
er imports:<br><br><div style=3D"background-color:rgb(250,250,250);border-c=
olor:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:break-w=
ord"><code><div><span style=3D"color:#800">#if CPP_9803</span><span style=
=3D"color:#000"><br></span><span style=3D"color:#008">import</span><span st=
yle=3D"color:#000"> std</span><span style=3D"color:#660">.</span><span styl=
e=3D"color:#000">vector</span><span style=3D"color:#660">.</span><span styl=
e=3D"color:#066">98</span><span style=3D"color:#000">_03<br></span><span st=
yle=3D"color:#800">#elseif CPP11</span><span style=3D"color:#000"><br></spa=
n><span style=3D"color:#008">import</span><span style=3D"color:#000"> std</=
span><span style=3D"color:#660">.</span><span style=3D"color:#000">vector</=
span><span style=3D"color:#660">.</span><span style=3D"color:#066">11</span=
><span style=3D"color:#000"><br></span><span style=3D"color:#800">#elseif C=
PP14</span><span style=3D"color:#000"><br></span><span style=3D"color:#008"=
>import</span><span style=3D"color:#000"> std</span><span style=3D"color:#6=
60">.</span><span style=3D"color:#000">vector</span><span style=3D"color:#6=
60">.</span><span style=3D"color:#066">14</span><span style=3D"color:#000">=
<br></span><span style=3D"color:#800">#else</span><span style=3D"color:#000=
"><br></span><span style=3D"color:#008">import</span><span style=3D"color:#=
000"> std</span><span style=3D"color:#660">.</span><span style=3D"color:#00=
0">vector</span><span style=3D"color:#660">.</span><span style=3D"color:#06=
6">17</span><span style=3D"color:#000"><br></span><span style=3D"color:#800=
">#endif</span></div></code></div><br></div></div></blockquote><div></div><=
blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border=
-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>These defines =
would generally be specified on the command line.<br></div></div></blockquo=
te><div>Does it mean many source files should be modified like this, or jus=
t better allow different styles coexist in the library source? <br></div></=
blockquote><div><br>This is merely a solution to the issue of versioning th=
at you raised. If you have different versions of a module that you want to =
deliver based on some macro, this would be an adequate solution to that.<br=
><br>Personally, I would avoid having different versions of the same module=
 delivered based on a macro. But if that&#39;s not possible for you, this i=
s one alternative solution.<br><br>Another would be to build the module as =
part of the build system, and have the macro be a command-line thing. That =
way, the specific standard library module that they use would be built for =
each user as needed, based on their command-line #define parameters.<br><br=
>This means that all code must be compiled under the same parameters, but t=
hat is the way it always was, thanks to ODR.</div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_237_991806680.1449583372669--
------=_Part_236_389785199.1449583372669--

.