Topic: Guarantee copy elision of named objects if their
Author: Antonio Perez <antonio@perezexcelsior.com>
Date: Wed, 30 May 2018 13:15:47 -0700 (PDT)
Raw View
------=_Part_46042_1051799229.1527711347678
Content-Type: multipart/alternative;
boundary="----=_Part_46043_1824164097.1527711347679"
------=_Part_46043_1824164097.1527711347679
Content-Type: text/plain; charset="UTF-8"
*Current status*
Copy elision is guaranteed when a prvalue is returned from a function:
T foo() {
return T();
}
Additionally, the compiler may perform copy elision if the object is named
in the function:
T foo(){
T myFoo{};
return myFoo; //Maybe performs copy elision
}
*Proposal*
Guarantee copy elision of object x returned from a function if:
- x is not static
- x is not declared outside the body of the function
- the address of or a reference to x is not exported* from the function
(*I will define this word below)
- x is a complete object
struct A {
A* ptr;
A() { ptr = this; }
}
A foo(){
A a {};
//Address is exported; copy elision is no longer guaranteed
return a;
}
T* GLOBAL_T_PTR;
T foo() {
T myFoo();
GLOBAL_T_PTR = &myFoo; //Address is exported; copy elision is no longer
guaranteed
return myFoo;
}
struct A {
};
struct B {
A& ref;
B(A& _ref) : ref(_ref) {}
};
A foo(B* &ptr){
A val;
ptr = new B(val);
return val; //Reference is exported; copy elision is no longer
guaranteed
}
struct A;
A* GLOBAL_A_PTR;
struct A {
A() {}
A(const A& val) { GLOBAL_A_PTR = this; }
};
A foo(){
A a;
return a; //address of copy-constructed object would have been
exported; copy elision is no longer guaranteed
}
*Definition of export*
A function exports an address or reference if that address or reference is
(potentially) stored externally as a result of a side-effect of the
function. If it is not known at compile time whether or not an export will
occur, copy elision is not guaranteed. If a reference or address is passed
to a function with external linkage, copy elision is not guaranteed. If a
address or reference is passed to a function whose definition is visible to
the compiler, then it is not exported if that function does not export it.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/dc8e8061-4e85-46d7-acb5-63c06dee859a%40isocpp.org.
------=_Part_46043_1824164097.1527711347679
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div><b>Current status</b></div>Copy elision is guaranteed=
when a prvalue is returned from a function:<div><br></div><div><div class=
=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187, 187); word-wrap: =
break-word;"><code class=3D"prettyprint"><div class=3D"subprettyprint" styl=
e=3D"caret-color: rgb(102, 0, 102);"><span style=3D"background-color: rgb(2=
55, 255, 255);"><span style=3D"color: #000;" class=3D"styled-by-prettify">T=
foo</span><span style=3D"color: #660;" class=3D"styled-by-prettify">()</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span s=
tyle=3D"color: #008;" class=3D"styled-by-prettify">return</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> T</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">();</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">}</span></span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br></span></div></code></div><br>Additionally, the=
compiler may perform copy elision if the object is named in the function:<=
/div><div><div class=3D"prettyprint" style=3D"border: 1px solid rgb(187, 18=
7, 187); word-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"=
subprettyprint" style=3D"caret-color: rgb(102, 0, 102);"><font color=3D"#66=
0066"><span style=3D"background-color: rgb(255, 255, 255);"><span style=3D"=
color: #000;" class=3D"styled-by-prettify">T foo</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">(){</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 T myFoo</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">{};</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span styl=
e=3D"color: #008;" class=3D"styled-by-prettify">return</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> myFoo</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> </span><span style=3D"color: #800;" class=
=3D"styled-by-prettify">//Maybe performs copy elision</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color:=
#660;" class=3D"styled-by-prettify">}</span></span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"><br></span></font></div></code></div><br=
><b>Proposal</b></div><div>Guarantee copy elision of object x<i>=C2=A0</i>r=
eturned from a function<i>=C2=A0</i>if:</div><div><ul><li>x is not static</=
li><li>x is not declared outside the body of the function</li><li>the addre=
ss of or a reference to x is not exported* from the function (*I will defin=
e this word below)</li><li>x is a complete object</li></ul></div><div><br><=
/div><div><div class=3D"prettyprint" style=3D"border: 1px solid rgb(187, 18=
7, 187); word-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"=
subprettyprint" style=3D"background-color: rgb(255, 255, 255);"><span style=
=3D"color: #008;" class=3D"styled-by-prettify">struct</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> A </span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 A</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">*</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> ptr</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br>=C2=A0 =C2=A0 A</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">()</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify"> </span><font color=3D"#666600"><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> ptr </span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">th=
is</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">}</span></font><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">}</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"><br>A foo</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">(){</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 A a </span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">{};</span><font><span style=3D"color: #=
000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"=
caret-color: rgb(102, 0, 102); color: rgb(136, 0, 0);"><span style=3D"color=
: #800;" class=3D"styled-by-prettify">//Address is exported; copy elision i=
s no longer guaranteed </span></span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" c=
lass=3D"styled-by-prettify">return</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> a</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">;</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></font></div></code></div><br><div class=3D"prettyprint" style=3D=
"border: 1px solid rgb(187, 187, 187); word-wrap: break-word;"><code class=
=3D"prettyprint"><div class=3D"subprettyprint"><font style=3D"background-co=
lor: rgb(255, 255, 255);"><span style=3D"color: #000;" class=3D"styled-by-p=
rettify">T</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
*</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> GLOBAL_T=
_PTR</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>T foo</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><font co=
lor=3D"#000000"><span style=3D"caret-color: rgb(102, 0, 102);"><span style=
=3D"color: #660;" class=3D"styled-by-prettify">)</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"><br>=C2=A0 =C2=A0 T myFoo</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">();</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 GLOBAL_T_PTR </span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">&</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify">myFoo</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> </span><span style=3D"color: #800;" class=3D"styled-by-pret=
tify">//Address is exported; copy elision is no longer guaranteed </span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 <=
/span><span style=3D"color: #008;" class=3D"styled-by-prettify">return</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"> myFoo</span><s=
pan 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"co=
lor: #660;" class=3D"styled-by-prettify">}</span></span></font></font></div=
></code></div><div><br></div><div class=3D"prettyprint" style=3D"border: 1p=
x solid rgb(187, 187, 187); word-wrap: break-word;"><code class=3D"prettypr=
int"><div class=3D"subprettyprint" style=3D"caret-color: rgb(102, 0, 102); =
background-color: rgb(255, 255, 255);"><span style=3D"color: #008;" class=
=3D"styled-by-prettify">struct</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> A </span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"><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: #008;" class=3D"styled-by-prettify">struct</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> B </span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 A</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">&</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #0=
08;" class=3D"styled-by-prettify">ref</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"><br>=C2=A0 =C2=A0 B</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify">A</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">&</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> _ref</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">:</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><font color=3D"#6666=
00"><span style=3D"color: #008;" class=3D"styled-by-prettify">ref</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">_ref</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">)</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">{}</span></font><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">};</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"><br>A foo</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
B</span><span style=3D"color: #660;" class=3D"styled-by-prettify">*</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">&</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify">ptr</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">){</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 A val</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 ptr </span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color:=
#000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" c=
lass=3D"styled-by-prettify">new</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"> B</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy">val</span><span style=3D"color: #660;" class=3D"styled-by-prettify">);<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =
=C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prettify">ret=
urn</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> val</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span=
style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D=
"color: #800;" class=3D"styled-by-prettify">//Reference is exported; copy e=
lision is no longer guaranteed</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><br><div class=3D"prettyprint" sty=
le=3D"border: 1px solid rgb(187, 187, 187); word-wrap: break-word;"><code c=
lass=3D"prettyprint"><div class=3D"subprettyprint" style=3D"caret-color: rg=
b(102, 0, 102);"><font color=3D"#660066" style=3D"background-color: rgb(255=
, 255, 255);"><span style=3D"color: #008;" class=3D"styled-by-prettify">str=
uct</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> A</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"><br>A</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">*</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> GLOBAL_A_PTR</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" cla=
ss=3D"styled-by-prettify">struct</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> A </span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"><br>=C2=A0 =C2=A0 A</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">()</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
{}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=
=A0 =C2=A0 A</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">(</span><span style=3D"color: #008;" class=3D"styled-by-prettify">const</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> A</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">&</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> val</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">)</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> GLOBAL_A_PTR </span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-prett=
ify">this</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><s=
pan 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"co=
lor: #660;" class=3D"styled-by-prettify">};</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"><br>A foo</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">(){</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 A a</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #=
008;" class=3D"styled-by-prettify">return</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> a</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> </span><span style=3D"color: #800;" class=3D"styled-by-pret=
tify">//address of copy-constructed object would have been exported; copy e=
lision is no longer guaranteed</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"><br></span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">}</span></font></div></code></div><div><br></div><div><br></d=
iv><br><b>Definition of export</b></div><div>A function exports an address =
or reference if that address or reference is (potentially) stored externall=
y as a result of a side-effect of the function. If it is not known at compi=
le time whether or not an export will occur, copy elision is not guaranteed=
.. If a reference or address is passed to a function with external linkage, =
copy elision is not guaranteed. If a address or reference is passed to a fu=
nction whose definition is visible to the compiler, then it is not exported=
if that function does not export it.=C2=A0</div><div><br></div><div><br></=
div><div><br></div></div>
<p></p>
-- <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 <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/dc8e8061-4e85-46d7-acb5-63c06dee859a%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/dc8e8061-4e85-46d7-acb5-63c06dee859a=
%40isocpp.org</a>.<br />
------=_Part_46043_1824164097.1527711347679--
------=_Part_46042_1051799229.1527711347678--
.
Author: Antonio Perez <antonio@perezexcelsior.com>
Date: Wed, 30 May 2018 13:22:14 -0700 (PDT)
Raw View
------=_Part_46674_1024079430.1527711734877
Content-Type: multipart/alternative;
boundary="----=_Part_46675_1055360830.1527711734877"
------=_Part_46675_1055360830.1527711734877
Content-Type: text/plain; charset="UTF-8"
Addendum: if an object X (for whatever reason) stores, references, or
contains a pointer to another object Y, such that Y references X or stores
a pointer to X, X was "exported." If the move or copy constructor of X
exports the address of the move or copy-constructed object, X was
"exported". If X is "exported", then copy elision of X is not guaranteed
when X is returned.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/63f6e512-8948-4918-ac02-1fbe5117c1c3%40isocpp.org.
------=_Part_46675_1055360830.1527711734877
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Addendum: if an object X (for whatever reason) stores, ref=
erences, or contains a pointer to another object Y, such that Y references =
X or stores a pointer to X, X was "exported." If the move or copy=
constructor of X exports the address of the move or copy-constructed objec=
t, X was "exported". If X is "exported", then copy elis=
ion of X is not guaranteed when X is returned.=C2=A0</div>
<p></p>
-- <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 <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/63f6e512-8948-4918-ac02-1fbe5117c1c3%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/63f6e512-8948-4918-ac02-1fbe5117c1c3=
%40isocpp.org</a>.<br />
------=_Part_46675_1055360830.1527711734877--
------=_Part_46674_1024079430.1527711734877--
.
Author: Thiago Macieira <thiago@macieira.org>
Date: Wed, 30 May 2018 21:13:14 -0700
Raw View
On Wednesday, 30 May 2018 13:15:47 PDT Antonio Perez wrote:
> *Definition of export*
> A function exports an address or reference if that address or reference is
> (potentially) stored externally as a result of a side-effect of the
> function. If it is not known at compile time whether or not an export will
> occur, copy elision is not guaranteed. If a reference or address is passed
> to a function with external linkage, copy elision is not guaranteed. If a
> address or reference is passed to a function whose definition is visible to
> the compiler, then it is not exported if that function does not export it.
Remove the wording about external and internal linkage. Instead, talk about
constexpr and non-constexpr. You cannot require a compiler to perform the
analysis of what a local function will do.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/2311042.9aNCWPonoe%40tjmaciei-mobl1.
.