Topic: A better C++ interface syntax
Author: pony279@qq.com
Date: Tue, 30 Apr 2013 05:50:45 -0700 (PDT)
Raw View
------=_Part_4606_11256916.1367326245764
Content-Type: text/plain; charset=ISO-8859-1
I remember many times when I modified some class decleration in my own
general purpose library's header of my project, even though I was just
adding a private member/member function, the whole project may need to be
recompiled. ( Though, modifying an existing library used by a project may
be a very bad choice.)
If you have the same complain, please consider the following syntax:
// file name: C.h, the interface header
interface class C{
// public methods
void fun();
};
//file name: C.cpp
implement /* or interface_detail ? */ class C{ // non-public member
decleration
int data_member;
void private_function();
}/* a function C::size() is implicitly generated by the compiler. here */
// note that the keyword class is not necessarily needed.
// the following is the definition of interface functions and private
member function
void C::fun(){
// blah blah blah ...
}
// file name: main.cpp, the user. The interface C is used like a normal c++
class.
int main(){
C c;
// call C::size() to get its size and
// allocate space like a dynamic array on stack
// char c[C::size()] (aligning issue is not considered here).
// then, call C::C() to construct object c.
// For example, the compiler may translate it to the following code:
// char c[C::size()];
// new (c) C(); // placement new
c.fun();
// when goes out of scope, calls ~C::C()
// then de-allocate object c's space on stack
// just like de-allocating a dynamic array on stack
}
Here's a list of the advantages and disavantages I can see:
*advantages*:
a. If any data member or private function added/deleted/renamed, any other
modules including the interface header file don't have to be recompiled,
because only the C.cpp file is modidied. This is perfect for many library
interface implementation.
b. Obviously better encapsulation, all data member is completely hided,
only public method is exposed.
c. More efficient than the PIMPL idiom's traditional implementation, which
may use the c++'s new operator and it's behavior is more complicated.
d. More readable than the PIMPL idiom's traditional implementation, because
we don't need an explicit extra pointer in our code.
*
*
*disavantages*:
a. sizeof(C) is cannot be known at compile time.
b. a little-bit run time O(1) overhead, I think.
c. Sometimes It gets really complicated for the compiler when:
class D{
int a;
C c;
....
};
and we may wanna fobid this kind of usage.
*Implementability*
From the example, It looks like everything is very easy to implemented for
a compiler except dynamic memory on stack. Actually Some compiler already
support dynamic memory on stack (I've never used this feature since it's
not promised by the standard, but I've seen proposals on this topic).
So what's your opinion on this?
--
---
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/?hl=en.
------=_Part_4606_11256916.1367326245764
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<p style=3D"margin: 0px 0px 1em; padding: 0px; border: 0px; font-size: 14px=
; vertical-align: baseline; background-color: rgb(255, 255, 255); clear: bo=
th; word-wrap: break-word; color: rgb(0, 0, 0); font-family: Arial, 'Libera=
tion Sans', 'DejaVu Sans', sans-serif; font-style: normal; font-variant: no=
rmal; font-weight: normal; letter-spacing: normal; line-height: 18px; orpha=
ns: 2; text-align: left; text-indent: 0px; text-transform: none; white-spac=
e: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -w=
ebkit-text-stroke-width: 0px; background-position: initial initial; backgro=
und-repeat: initial initial;">I remember many times when I modified some cl=
ass decleration in my own general purpose library's header of my project, e=
ven though I was just adding a private member/member function, the whole pr=
oject may need to be recompiled. ( Though, modifying an existing library us=
ed by a project may be a very bad choice.)</p><p style=3D"margin: 0px 0px 1=
em; padding: 0px; border: 0px; font-size: 14px; vertical-align: baseline; b=
ackground-color: rgb(255, 255, 255); clear: both; word-wrap: break-word; co=
lor: rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sa=
ns-serif; font-style: normal; font-variant: normal; font-weight: normal; le=
tter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text=
-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-sp=
acing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;=
background-position: initial initial; background-repeat: initial initial;"=
>If you have the same complain, please consider the following syntax:</p><p=
style=3D"margin: 0px 0px 1em; padding: 0px; border: 0px; font-size: 14px; =
vertical-align: baseline; background-color: rgb(255, 255, 255); clear: both=
; word-wrap: break-word; color: rgb(0, 0, 0); font-family: Arial, 'Liberati=
on Sans', 'DejaVu Sans', sans-serif; font-style: normal; font-variant: norm=
al; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans=
: 2; text-align: left; text-indent: 0px; text-transform: none; white-space:=
normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -web=
kit-text-stroke-width: 0px; background-position: initial initial; backgroun=
d-repeat: initial initial;"></p><div class=3D"prettyprint" style=3D"backgro=
und-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-sty=
le: solid; border-width: 1px; word-wrap: break-word;"><code class=3D"pretty=
print"><div class=3D"subprettyprint"><span style=3D"color: #800;" class=3D"=
styled-by-prettify">// file name: C.h, the interface header</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"=
color: #008;" class=3D"styled-by-prettify">interface</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #00=
8;" class=3D"styled-by-prettify">class</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> C</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br> </span><span style=3D"color: #800;" class=3D"s=
tyled-by-prettify">// public methods</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"><br> </span><span style=3D"color: #0=
08;" class=3D"styled-by-prettify">void</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> fun</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">();</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"><br></span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">};</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"><br><br></span><span style=3D"color: #800;" class=3D"styled-by-prettify"=
>//file name: C.cpp</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"><br>implement </span><span style=3D"color: #800;" class=3D"styled-=
by-prettify">/* or interface_detail ? */</span><span style=3D"color: #000;"=
class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D=
"styled-by-prettify">class</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> C</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
</span><span style=3D"color: #800;" class=3D"styled-by-prettify">// n=
on-public member decleration</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"><br> </span><span style=3D"color: #008;" cla=
ss=3D"styled-by-prettify">int</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> data_member</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br> </span><span style=3D"color: #008;" class=3D"=
styled-by-prettify">void</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> private_function</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">();</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"><br></span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">}</span><span style=3D"color: #800;" class=3D"styled-by-prettify">/=
* a function C::size() is implicitly generated by the compiler. here */</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br></span=
><span style=3D"color: #800;" class=3D"styled-by-prettify">// note that the=
keyword class is not necessarily needed.</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"><br><br></span><span style=3D"color: #800;" =
class=3D"styled-by-prettify">// the following is the definition of interfac=
e functions and private member function</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">void</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> C</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
">fun</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(){</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br> &=
nbsp; </span><span style=3D"color: #800;" class=3D"styled-by-prettify">// b=
lah blah blah ...</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"><br></span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=
<br></span><span style=3D"color: #800;" class=3D"styled-by-prettify">// fil=
e name: main.cpp, the user. The interface C is used like a normal c++ class=
..</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></spa=
n><span style=3D"color: #008;" class=3D"styled-by-prettify">int</span><span=
style=3D"color: #000;" class=3D"styled-by-prettify"> main</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">(){</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"><br> C c</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"><br> </span><span s=
tyle=3D"color: #800;" class=3D"styled-by-prettify">// call C::size() to get=
its size and</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"><br> </span><span style=3D"color: #800;" class=3D"styled-by=
-prettify">// allocate space like a dynamic array on stack</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"><br> </span><s=
pan style=3D"color: #800;" class=3D"styled-by-prettify">// char c[C::size()=
] (aligning issue is not considered here).</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"><br> </span><span style=3D"col=
or: #800;" class=3D"styled-by-prettify">// then, call C::C() to construct o=
bject c.</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><b=
r> </span><span style=3D"color: #800;" class=3D"styled-by-pret=
tify">// For example, the compiler may translate it to the following code:<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br> =
</span><span style=3D"color: #800;" class=3D"styled-by-prettify">// =
char c[C::size()];</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"><br> </span><span style=3D"color: #800;" class=3D"styl=
ed-by-prettify">// new (c) C(); // placement new</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"><br><br> c</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">.</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify">fun</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">();</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"><br><br> </span><span style=
=3D"color: #800;" class=3D"styled-by-prettify">// when goes out of scope, c=
alls ~C::C()</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"><br> </span><span style=3D"color: #800;" class=3D"styled-by-=
prettify">// then de-allocate object c's space on stack </span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br> </span><sp=
an style=3D"color: #800;" class=3D"styled-by-prettify">// just like de-allo=
cating a dynamic array on stack</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"><br></span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">}</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"><br></span></div></code></div><p></p><p style=3D"margin: 0px 0px 1em;=
padding: 0px; border: 0px; font-size: 14px; vertical-align: baseline; back=
ground-color: rgb(255, 255, 255); clear: both; word-wrap: break-word; color=
: rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-=
serif; font-style: normal; font-variant: normal; font-weight: normal; lette=
r-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-in=
dent: 0px; text-transform: none; white-space: normal; widows: 2; word-spaci=
ng: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ba=
ckground-position: initial initial; background-repeat: initial initial;">He=
re's a list of the advantages and disavantages I can see:<br></p><p style=
=3D"margin: 0px 0px 1em; padding: 0px; border: 0px; font-size: 14px; vertic=
al-align: baseline; background-color: rgb(255, 255, 255); clear: both; word=
-wrap: break-word; color: rgb(0, 0, 0); font-family: Arial, 'Liberation San=
s', 'DejaVu Sans', sans-serif; font-style: normal; font-variant: normal; fo=
nt-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; t=
ext-align: left; text-indent: 0px; text-transform: none; white-space: norma=
l; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-te=
xt-stroke-width: 0px; background-position: initial initial; background-repe=
at: initial initial;"><strong style=3D"margin: 0px; padding: 0px; border: 0=
px; font-size: 14px; vertical-align: baseline; background-color: transparen=
t; font-weight: bold; background-position: initial initial; background-repe=
at: initial initial;">advantages</strong>:<span class=3D"Apple-converted-sp=
ace"> </span><br></p><p style=3D"margin: 0px 0px 1em; padding: 0px; border:=
0px; font-size: 14px; vertical-align: baseline; background-color: rgb(255,=
255, 255); clear: both; word-wrap: break-word; color: rgb(0, 0, 0); font-f=
amily: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-style: nor=
mal; font-variant: normal; font-weight: normal; letter-spacing: normal; lin=
e-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transf=
orm: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-=
size-adjust: auto; -webkit-text-stroke-width: 0px; background-position: ini=
tial initial; background-repeat: initial initial;">a. If any data member or=
private function added/deleted/renamed, any other modules including the in=
terface header file don't have to be recompiled, because only the C.cpp fil=
e is modidied. This is perfect for many library interface implementation.<s=
pan class=3D"Apple-converted-space"> </span><br></p><p style=3D"margin: 0px=
0px 1em; padding: 0px; border: 0px; font-size: 14px; vertical-align: basel=
ine; background-color: rgb(255, 255, 255); clear: both; word-wrap: break-wo=
rd; color: rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu San=
s', sans-serif; font-style: normal; font-variant: normal; font-weight: norm=
al; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left=
; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; w=
ord-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width=
: 0px; background-position: initial initial; background-repeat: initial ini=
tial;">b. Obviously better encapsulation, all data member is completely hid=
ed, only public method is exposed.<br></p><p style=3D"margin: 0px 0px 1em; =
padding: 0px; border: 0px; font-size: 14px; vertical-align: baseline; backg=
round-color: rgb(255, 255, 255); clear: both; word-wrap: break-word; color:=
rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-s=
erif; font-style: normal; font-variant: normal; font-weight: normal; letter=
-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-ind=
ent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacin=
g: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; bac=
kground-position: initial initial; background-repeat: initial initial;">c. =
More efficient than the PIMPL idiom's traditional implementation, which may=
use the c++'s new operator and it's behavior is more complicated. </p=
><p style=3D"margin: 0px 0px 1em; padding: 0px; border: 0px; font-size: 14p=
x; vertical-align: baseline; background-color: rgb(255, 255, 255); clear: b=
oth; word-wrap: break-word; color: rgb(0, 0, 0); font-family: Arial, 'Liber=
ation Sans', 'DejaVu Sans', sans-serif; font-style: normal; font-variant: n=
ormal; font-weight: normal; letter-spacing: normal; line-height: 18px; orph=
ans: 2; text-align: left; text-indent: 0px; text-transform: none; white-spa=
ce: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -=
webkit-text-stroke-width: 0px; background-position: initial initial; backgr=
ound-repeat: initial initial;">d. More readable than the PIMPL idiom's trad=
itional implementation, because we don't need an explicit extra pointer in =
our code.<br></p><p style=3D"margin: 0px 0px 1em; padding: 0px; border: 0px=
; font-size: 14px; vertical-align: baseline; background-color: rgb(255, 255=
, 255); clear: both; word-wrap: break-word; color: rgb(0, 0, 0); font-famil=
y: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-style: normal;=
font-variant: normal; font-weight: normal; letter-spacing: normal; line-he=
ight: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform:=
none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size=
-adjust: auto; -webkit-text-stroke-width: 0px; background-position: initial=
initial; background-repeat: initial initial;"><strong style=3D"margin: 0px=
; padding: 0px; border: 0px; font-size: 14px; vertical-align: baseline; bac=
kground-color: transparent; font-weight: bold; background-position: initial=
initial; background-repeat: initial initial;"><br></strong></p><p style=3D=
"margin: 0px 0px 1em; padding: 0px; border: 0px; font-size: 14px; vertical-=
align: baseline; background-color: rgb(255, 255, 255); clear: both; word-wr=
ap: break-word; color: rgb(0, 0, 0); font-family: Arial, 'Liberation Sans',=
'DejaVu Sans', sans-serif; font-style: normal; font-variant: normal; font-=
weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text=
-align: left; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-=
stroke-width: 0px; background-position: initial initial; background-repeat:=
initial initial;"><strong style=3D"margin: 0px; padding: 0px; border: 0px;=
font-size: 14px; vertical-align: baseline; background-color: transparent; =
font-weight: bold; background-position: initial initial; background-repeat:=
initial initial;">disavantages</strong>:<span class=3D"Apple-converted-spa=
ce"></span></p><p style=3D"margin: 0px 0px 1em; padding: 0px; border: 0px; =
font-size: 14px; vertical-align: baseline; background-color: rgb(255, 255, =
255); clear: both; word-wrap: break-word; color: rgb(0, 0, 0); font-family:=
Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-style: normal; f=
ont-variant: normal; font-weight: normal; letter-spacing: normal; line-heig=
ht: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: n=
one; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-a=
djust: auto; -webkit-text-stroke-width: 0px; background-position: initial i=
nitial; background-repeat: initial initial;"><span class=3D"Apple-converted=
-space"></span>a. sizeof(C) is cannot be known at compile time.<span class=
=3D"Apple-converted-space"></span><br></p><p style=3D"margin: 0px 0px 1em; =
padding: 0px; border: 0px; font-size: 14px; vertical-align: baseline; backg=
round-color: rgb(255, 255, 255); clear: both; word-wrap: break-word; color:=
rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-s=
erif; font-style: normal; font-variant: normal; font-weight: normal; letter=
-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-ind=
ent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacin=
g: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; bac=
kground-position: initial initial; background-repeat: initial initial;">b. =
a little-bit run time O(1) overhead, I think.<span class=3D"Apple-converted=
-space"></span><br></p><p style=3D"margin: 0px 0px 1em; padding: 0px; borde=
r: 0px; font-size: 14px; vertical-align: baseline; background-color: rgb(25=
5, 255, 255); clear: both; word-wrap: break-word; color: rgb(0, 0, 0); font=
-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-style: n=
ormal; font-variant: normal; font-weight: normal; letter-spacing: normal; l=
ine-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-tran=
sform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-tex=
t-size-adjust: auto; -webkit-text-stroke-width: 0px; background-position: i=
nitial initial; background-repeat: initial initial;">c. Sometimes It gets r=
eally complicated for the compiler when: <br></p><div class=3D"prettyprint"=
style=3D"background-color: rgb(250, 250, 250); border-color: rgb(187, 187,=
187); border-style: solid; border-width: 1px; word-wrap: break-word;"><cod=
e class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color:=
#008;" class=3D"styled-by-prettify">class</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> D</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-p=
rettify">int</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> a</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>C c</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> <br></span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">...</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #660;"=
class=3D"styled-by-prettify">};</span></div></code></div><p style=3D"margi=
n: 0px 0px 1em; padding: 0px; border: 0px; font-size: 14px; vertical-align:=
baseline; background-color: rgb(255, 255, 255); clear: both; word-wrap: br=
eak-word; color: rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', 'Deja=
Vu Sans', sans-serif; font-style: normal; font-variant: normal; font-weight=
: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align=
: left; text-indent: 0px; text-transform: none; white-space: normal; widows=
: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke=
-width: 0px; background-position: initial initial; background-repeat: initi=
al initial;">and we may wanna fobid this kind of usage.</p><p style=3D"marg=
in: 0px 0px 1em; padding: 0px; border: 0px; font-size: 14px; vertical-align=
: baseline; background-color: rgb(255, 255, 255); clear: both; word-wrap: b=
reak-word; color: rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', 'Dej=
aVu Sans', sans-serif; font-style: normal; font-variant: normal; font-weigh=
t: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-alig=
n: left; text-indent: 0px; text-transform: none; white-space: normal; widow=
s: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-strok=
e-width: 0px; background-position: initial initial; background-repeat: init=
ial initial;"><br></p><p style=3D"margin: 0px 0px 1em; padding: 0px; border=
: 0px; font-size: 14px; vertical-align: baseline; background-color: rgb(255=
, 255, 255); clear: both; word-wrap: break-word; color: rgb(0, 0, 0); font-=
family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-style: no=
rmal; font-variant: normal; font-weight: normal; letter-spacing: normal; li=
ne-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-trans=
form: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text=
-size-adjust: auto; -webkit-text-stroke-width: 0px; background-position: in=
itial initial; background-repeat: initial initial;"><b>Implementability</b>=
<br></p><p style=3D"margin: 0px 0px 1em; padding: 0px; border: 0px; font-si=
ze: 14px; vertical-align: baseline; background-color: rgb(255, 255, 255); c=
lear: both; word-wrap: break-word; color: rgb(0, 0, 0); font-family: Arial,=
'Liberation Sans', 'DejaVu Sans', sans-serif; font-style: normal; font-var=
iant: normal; font-weight: normal; letter-spacing: normal; line-height: 18p=
x; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; wh=
ite-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; background-position: initial initial;=
background-repeat: initial initial;"><span style=3D"color: rgb(0, 0, 0); f=
ont-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size:=
14px; font-style: normal; font-variant: normal; font-weight: normal; lette=
r-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-in=
dent: 0px; text-transform: none; white-space: normal; widows: 2; word-spaci=
ng: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ba=
ckground-color: rgb(255, 255, 255); display: inline !important; float: none=
;">From the example, It looks like everything is very easy to implemented f=
or a compiler except dynamic memory on stack. Actually Some compiler alread=
y support dynamic memory on stack (I've never used this feature since it's =
not promised by the standard, but I've seen proposals on this topic).<span =
class=3D"Apple-converted-space"> </span></span><span style=3D"color: rgb(0,=
0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; f=
ont-size: 14px; font-style: normal; font-variant: normal; font-weight: norm=
al; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left=
; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; w=
ord-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width=
: 0px; background-color: rgb(255, 255, 255); display: inline !important; fl=
oat: none;"><br></span></p><p style=3D"margin: 0px 0px 1em; padding: 0px; b=
order: 0px; font-size: 14px; vertical-align: baseline; background-color: rg=
b(255, 255, 255); clear: both; word-wrap: break-word; color: rgb(0, 0, 0); =
font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-styl=
e: normal; font-variant: normal; font-weight: normal; letter-spacing: norma=
l; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-=
transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit=
-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-positio=
n: initial initial; background-repeat: initial initial;"><span style=3D"col=
or: rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu Sans', san=
s-serif; font-size: 14px; font-style: normal; font-variant: normal; font-we=
ight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-a=
lign: left; text-indent: 0px; text-transform: none; white-space: normal; wi=
dows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-st=
roke-width: 0px; background-color: rgb(255, 255, 255); display: inline !imp=
ortant; float: none;">So what's your opinion on this?</span></p>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_4606_11256916.1367326245764--
.
Author: Jonathan Wakely <cxx@kayari.org>
Date: Tue, 30 Apr 2013 06:59:58 -0700 (PDT)
Raw View
------=_Part_4381_25791305.1367330398145
Content-Type: text/plain; charset=ISO-8859-1
On Tuesday, April 30, 2013 1:50:45 PM UTC+1, pon...@qq.com wrote:
>
>
> So what's your opinion on this?
>
You want C++ Modules. There is already a study group within the committee
working on this area.
See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3347.pdf and
http://llvm.org/devmtg/2012-11/videos/Gregor-Modules.mp4 for more details.
--
---
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/?hl=en.
------=_Part_4381_25791305.1367330398145
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<br><br>On Tuesday, April 30, 2013 1:50:45 PM UTC+1, pon...@qq.com wrote:<b=
lockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;borde=
r-left: 1px #ccc solid;padding-left: 1ex;"><br><p style=3D"margin:0px 0px 1=
em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background=
-color:rgb(255,255,255);clear:both;word-wrap:break-word;color:rgb(0,0,0);fo=
nt-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font-style:norma=
l;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:=
18px;text-align:left;text-indent:0px;text-transform:none;white-space:normal=
;word-spacing:0px;background-repeat:initial initial"><span style=3D"color:r=
gb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font=
-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-=
spacing:normal;line-height:18px;text-align:left;text-indent:0px;text-transf=
orm:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,2=
55);display:inline!important;float:none">So what's your opinion on this?</s=
pan></p></blockquote><div><br>You want C++ Modules. There is already a stud=
y group within the committee working on this area.<br><br>See http://www.op=
en-std.org/jtc1/sc22/wg21/docs/papers/2012/n3347.pdf and http://llvm.org/de=
vmtg/2012-11/videos/Gregor-Modules.mp4 for more details.<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" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_4381_25791305.1367330398145--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Tue, 30 Apr 2013 09:35:34 -0700 (PDT)
Raw View
------=_Part_646_23646624.1367339734770
Content-Type: text/plain; charset=ISO-8859-1
On Tuesday, April 30, 2013 6:59:58 AM UTC-7, Jonathan Wakely wrote:
> On Tuesday, April 30, 2013 1:50:45 PM UTC+1, pon...@qq.com wrote:
>>
>>
>> So what's your opinion on this?
>>
>
> You want C++ Modules. There is already a study group within the committee
> working on this area.
>
> See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3347.pdf and
> http://llvm.org/devmtg/2012-11/videos/Gregor-Modules.mp4 for more details.
>
Which reminds me: was there much talk at the recent standards meeting on
the modules stuff? I know they've got a proof of concept being written in
Clang, which I understand Apple is pushing for. But it's been six months
since we last heard anything from it<http://isocpp.org/blog/2012/11/modules-update-on-work-in-progress-doug-gregor>,
and that was generally the same overview we've seen a half-dozen times
before.
Has there been actual movement towards standardization since the last time
we heard from them?
--
---
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/?hl=en.
------=_Part_646_23646624.1367339734770
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
On Tuesday, April 30, 2013 6:59:58 AM UTC-7, Jonathan Wakely wrote:<br><blo=
ckquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-=
left: 1px #ccc solid;padding-left: 1ex;">On Tuesday, April 30, 2013 1:50:45=
PM UTC+1, <a>pon...@qq.com</a> wrote:<blockquote class=3D"gmail_quote" sty=
le=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1e=
x"><br><p style=3D"margin:0px 0px 1em;padding:0px;border:0px;font-size:14px=
;vertical-align:baseline;background-color:rgb(255,255,255);clear:both;word-=
wrap:break-word;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaV=
u Sans',sans-serif;font-style:normal;font-variant:normal;font-weight:normal=
;letter-spacing:normal;line-height:18px;text-align:left;text-indent:0px;tex=
t-transform:none;white-space:normal;word-spacing:0px;background-repeat:init=
ial initial"><span style=3D"color:rgb(0,0,0);font-family:Arial,'Liberation =
Sans','DejaVu Sans',sans-serif;font-size:14px;font-style:normal;font-varian=
t:normal;font-weight:normal;letter-spacing:normal;line-height:18px;text-ali=
gn:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing=
:0px;background-color:rgb(255,255,255);display:inline!important;float:none"=
>So what's your opinion on this?</span></p></blockquote><div><br>You want C=
++ Modules. There is already a study group within the committee working on =
this area.<br><br>See <a href=3D"http://www.open-std.org/jtc1/sc22/wg21/doc=
s/papers/2012/n3347.pdf" target=3D"_blank">http://www.open-std.org/jtc1/<wb=
r>sc22/wg21/docs/papers/2012/<wbr>n3347.pdf</a> and <a href=3D"http://llvm.=
org/devmtg/2012-11/videos/Gregor-Modules.mp4" target=3D"_blank">http://llvm=
..org/devmtg/2012-<wbr>11/videos/Gregor-Modules.mp4</a> for more details.<br=
></div></blockquote><div><br>Which reminds me: was there much talk at the r=
ecent standards meeting on the modules stuff? I know they've got a proof of=
concept being written in Clang, which I understand Apple is pushing for. B=
ut it's been <a href=3D"http://isocpp.org/blog/2012/11/modules-update-on-wo=
rk-in-progress-doug-gregor">six months since we last heard anything from it=
</a>, and that was generally the same overview we've seen a half-dozen time=
s before.<br><br>Has there been actual movement towards standardization sin=
ce the last time we heard from them? <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" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_646_23646624.1367339734770--
.
Author: DeadMG <wolfeinstein@gmail.com>
Date: Tue, 30 Apr 2013 09:39:34 -0700 (PDT)
Raw View
------=_Part_344_8784096.1367339974091
Content-Type: text/plain; charset=ISO-8859-1
There was a modules meeting in Bristol. However, their wiki page only gives
an exceedingly brief presentation- no notes or anything more substantial.
--
---
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/?hl=en.
------=_Part_344_8784096.1367339974091
Content-Type: text/html; charset=ISO-8859-1
There was a modules meeting in Bristol. However, their wiki page only gives an exceedingly brief presentation- no notes or anything more substantial.
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href="http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en">http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en</a>.<br />
<br />
<br />
------=_Part_344_8784096.1367339974091--
.
Author: Tony V E <tvaneerd@gmail.com>
Date: Tue, 30 Apr 2013 13:04:56 -0400
Raw View
--047d7b3441fe37989104db97007d
Content-Type: text/plain; charset=ISO-8859-1
On Tue, Apr 30, 2013 at 9:59 AM, Jonathan Wakely <cxx@kayari.org> wrote:
>
>
> On Tuesday, April 30, 2013 1:50:45 PM UTC+1, pon...@qq.com wrote:
>>
>>
>> So what's your opinion on this?
>>
>
> You want C++ Modules. There is already a study group within the committee
> working on this area.
>
> See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3347.pdf and
> http://llvm.org/devmtg/2012-11/videos/Gregor-Modules.mp4 for more details.
>
> --
>
>
Modules won't solve the resizing issue of adding private member variables.
--
---
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/?hl=en.
--047d7b3441fe37989104db97007d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On Tue, Apr 30, 2013 at 9:59 AM, Jonathan Wakely <span dir=3D"ltr">=
<<a href=3D"mailto:cxx@kayari.org" target=3D"_blank">cxx@kayari.org</a>&=
gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"im"><br><br>On Tuesday, April =
30, 2013 1:50:45 PM UTC+1, <a href=3D"mailto:pon...@qq.com" target=3D"_blan=
k">pon...@qq.com</a> wrote:<blockquote class=3D"gmail_quote" style=3D"margi=
n:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><p style=3D"text-indent:0px;letter-spacing:normal;text-align:left;font-=
variant:normal;font-style:normal;font-weight:normal;padding:0px;vertical-al=
ign:baseline;clear:both;line-height:18px;text-transform:none;font-size:14px=
;white-space:normal;margin:0px 0px 1em;font-family:Arial,'Liberation Sa=
ns','DejaVu Sans',sans-serif;word-wrap:break-word;border:0px;ba=
ckground-repeat:initial initial;word-spacing:0px">
<span style=3D"text-indent:0px;letter-spacing:normal;font-variant:normal;te=
xt-align:left;font-style:normal;display:inline!important;font-weight:normal=
;float:none;line-height:18px;text-transform:none;font-size:14px;white-space=
:normal;font-family:Arial,'Liberation Sans','DejaVu Sans',s=
ans-serif;word-spacing:0px">So what's your opinion on this?</span></p>
</blockquote></div><div><br>You want C++ Modules. There is already a study =
group within the committee working on this area.<br><br>See <a href=3D"http=
://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3347.pdf" target=3D"_b=
lank">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3347.pdf</a>=
and <a href=3D"http://llvm.org/devmtg/2012-11/videos/Gregor-Modules.mp4" t=
arget=3D"_blank">http://llvm.org/devmtg/2012-11/videos/Gregor-Modules.mp4</=
a> for more details.<br>
</div><div class=3D"HOEnZb"><div class=3D"h5">
<p></p>
-- <br>=A0
<br></div></div></blockquote><div><br></div><div>Modules won't solve th=
e resizing issue of adding private member variables. <br></div></div></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" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
--047d7b3441fe37989104db97007d--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Tue, 30 Apr 2013 18:31:15 -0700 (PDT)
Raw View
------=_Part_1892_24618157.1367371875928
Content-Type: text/plain; charset=ISO-8859-1
On Tuesday, April 30, 2013 10:04:56 AM UTC-7, Tony V E wrote:
>
> On Tue, Apr 30, 2013 at 9:59 AM, Jonathan Wakely <c...@kayari.org<javascript:>
> > wrote:
>
>> On Tuesday, April 30, 2013 1:50:45 PM UTC+1, pon...@qq.com wrote:
>>>
>>>
>>> So what's your opinion on this?
>>>
>>
>> You want C++ Modules. There is already a study group within the committee
>> working on this area.
>>
>> See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3347.pdfand
>> http://llvm.org/devmtg/2012-11/videos/Gregor-Modules.mp4 for more
>> details.
>>
>> --
>>
>>
>
> Modules won't solve the resizing issue of adding private member variables.
>
It doesn't "solve" it in the strict since of not forcing a recompile of
every file that includes it. But it does solve it in the sense that it
makes such a recompile *much faster*.
Remember: every time a source file gets recompiled, so too does every
header that it uses. Take a look at your standard library's implementation
of <vector>. Or <map>. Or pretty much any of the main headers. They're
thousands of lines long. Every time a source file gets recompiled, the
compiler must recompile <vector>. <algorithm>. And so forth. It's
ridiculous.
Your main source code, the actual code you care about, is *dwarfed* by the
amount of code in headers.
When you make a change to the exported module, the only thing that will
need to be recompiled are those files that *directly* use that module. Even
if that's every source file in your project, the only thing that gets
recompiled are those source files. Each header they include is recompiled
exactly once. Not once for every inclusion: just *once*. None of the
standard library gets recompiled. And so forth.
So yes, a private variable change will still provoke recompilation in
non-local code. But modules will make recompilation a lot less scary, to
the point where we should be fine with it.
And we certainly shouldn't add special grammar like this just to avoid
recompiling.
--
---
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/?hl=en.
------=_Part_1892_24618157.1367371875928
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
On Tuesday, April 30, 2013 10:04:56 AM UTC-7, Tony V E wrote:<blockquote cl=
ass=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px =
#ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div><div class=3D"gmail_qu=
ote">On Tue, Apr 30, 2013 at 9:59 AM, Jonathan Wakely <span dir=3D"ltr"><=
;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"cY0my_4=
1W-4J">c...@kayari.org</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div>On Tuesday, April 30, 2013 1:50:45 PM U=
TC+1, <a>pon...@qq.com</a> wrote:<blockquote class=3D"gmail_quote" style=3D=
"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><p style=3D"text-indent:0px;letter-spacing:normal;text-align:left;font-=
variant:normal;font-style:normal;font-weight:normal;padding:0px;vertical-al=
ign:baseline;clear:both;line-height:18px;text-transform:none;font-size:14px=
;white-space:normal;margin:0px 0px 1em;font-family:Arial,'Liberation Sans',=
'DejaVu Sans',sans-serif;word-wrap:break-word;border:0px;background-repeat:=
initial initial;word-spacing:0px">
<span style=3D"text-indent:0px;letter-spacing:normal;font-variant:normal;te=
xt-align:left;font-style:normal;display:inline!important;font-weight:normal=
;float:none;line-height:18px;text-transform:none;font-size:14px;white-space=
:normal;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;word-s=
pacing:0px">So what's your opinion on this?</span></p>
</blockquote></div><div><br>You want C++ Modules. There is already a study =
group within the committee working on this area.<br><br>See <a href=3D"http=
://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3347.pdf" target=3D"_b=
lank">http://www.open-std.org/jtc1/<wbr>sc22/wg21/docs/papers/2012/<wbr>n33=
47.pdf</a> and <a href=3D"http://llvm.org/devmtg/2012-11/videos/Gregor-Modu=
les.mp4" target=3D"_blank">http://llvm.org/devmtg/2012-<wbr>11/videos/Grego=
r-Modules.mp4</a> for more details.<br>
</div><div><div>
<p></p>
-- <br>
<br></div></div></blockquote><div><br></div><div>Modules won't solve the re=
sizing issue of adding private member variables. <br></div></div></div></di=
v></blockquote><div><br>It doesn't "solve" it in the strict since of not fo=
rcing a recompile of every file that includes it. But it does solve it in t=
he sense that it makes such a recompile <i>much faster</i>.<br><br>Remember=
: every time a source file gets recompiled, so too does every header that i=
t uses. Take a look at your standard library's implementation of <vector=
>. Or <map>. Or pretty much any of the main headers. They're thous=
ands of lines long. Every time a source file gets recompiled, the compiler =
must recompile <vector>. <algorithm>. And so forth. It's ridicu=
lous.<br><br>Your main source code, the actual code you care about, is <i>d=
warfed</i> by the amount of code in headers.<br><br>When you make a change =
to the exported module, the only thing that will need to be recompiled are =
those files that <i>directly</i> use that module. Even if that's every sour=
ce file in your project, the only thing that gets recompiled are those sour=
ce files. Each header they include is recompiled exactly once. Not once for=
every inclusion: just <i>once</i>. None of the standard library gets recom=
piled. And so forth.<br><br>So yes, a private variable change will still pr=
ovoke recompilation in non-local code. But modules will make recompilation =
a lot less scary, to the point where we should be fine with it.<br><br>And =
we certainly shouldn't add special grammar like this just to avoid recompil=
ing.<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" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_1892_24618157.1367371875928--
.
Author: DeadMG <wolfeinstein@gmail.com>
Date: Tue, 30 Apr 2013 18:33:50 -0700 (PDT)
Raw View
------=_Part_4711_6075696.1367372030419
Content-Type: text/plain; charset=ISO-8859-1
>
> Remember: every time a source file gets recompiled, so too does every
> header that it uses. Take a look at your standard library's implementation
> of <vector>. Or <map>. Or pretty much any of the main headers. They're
> thousands of lines long. Every time a source file gets recompiled, the
> compiler must recompile <vector>. <algorithm>. And so forth. It's
> ridiculous.
A solid part of that is QoI issues. The ODR gives very liberal freedom to
compilers to not re-interpret the same inline functions/template
definitions/etc between TUs. If implementers actually took advantage of
this, they could save massive time.
--
---
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/?hl=en.
------=_Part_4711_6075696.1367372030419
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; borde=
r-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style=
: solid; padding-left: 1ex;">Remember: every time a source file gets recomp=
iled, so too does every header that it uses. Take a look at your standard l=
ibrary's implementation of <vector>. Or <map>. Or pretty much a=
ny of the main headers. They're thousands of lines long. Every time a sourc=
e file gets recompiled, the compiler must recompile <vector>. <alg=
orithm>. And so forth. It's ridiculous.</blockquote><div><br></div><div>=
A solid part of that is QoI issues. The ODR gives very liberal freedom to c=
ompilers to not re-interpret the same inline functions/template definitions=
/etc between TUs. If implementers actually took advantage of this, they cou=
ld save massive time.</div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_4711_6075696.1367372030419--
.
Author: Tony V E <tvaneerd@gmail.com>
Date: Wed, 1 May 2013 19:39:54 -0400
Raw View
--e89a8f83a63d87970204dbb0a2dc
Content-Type: text/plain; charset=ISO-8859-1
On Tue, Apr 30, 2013 at 9:31 PM, Nicol Bolas <jmckesson@gmail.com> wrote:
> On Tuesday, April 30, 2013 10:04:56 AM UTC-7, Tony V E wrote:
>
>>
>>
>> Modules won't solve the resizing issue of adding private member
>> variables.
>>
>
> It doesn't "solve" it in the strict since of not forcing a recompile of
> every file that includes it. But it does solve it in the sense that it
> makes such a recompile *much faster*.
>
>
True.
And there is nothing stopping a compiler from having a intermediate file
that keeps track of where the size of the class is used. So really, it
could just update those parts of the code that use the class's size.
I don't think any compiler is on the verge of doing that, but I suspect
modules will open up new opportunities that we have yet to think of.
Tony
--
---
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/?hl=en.
--e89a8f83a63d87970204dbb0a2dc
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On Tue, Apr 30, 2013 at 9:31 PM, Nicol Bolas <span dir=3D"ltr"><=
<a href=3D"mailto:jmckesson@gmail.com" target=3D"_blank">jmckesson@gmail.co=
m</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">On Tuesday, April 30, 2013 10:04:56 AM UTC-7=
, Tony V E wrote:<div class=3D"im"><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><div class=3D"gmail_quote"><br><div><br></div><div>Mo=
dules won't solve the resizing issue of adding private member variables=
.. <br></div></div></div></div></blockquote></div><div><br>It doesn't &q=
uot;solve" it in the strict since of not forcing a recompile of every =
file that includes it. But it does solve it in the sense that it makes such=
a recompile <i>much faster</i>.<br>
<br></div></blockquote><br></div>True.<br><br>And there is nothing stopping=
a compiler from having a intermediate file that keeps track of where the s=
ize of the class is used.=A0 So really, it could just update those parts of=
the code that use the class's size.<br>
<br></div><div class=3D"gmail_extra">I don't think any compiler is on t=
he verge of doing that, but I suspect modules will open up new opportunitie=
s that we have yet to think of.<br><br>Tony<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" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
--e89a8f83a63d87970204dbb0a2dc--
.