Topic: Implicit constexpr functions
Author: Dimitrij Mijoski <dim.mj.p@gmail.com>
Date: Tue, 21 Aug 2018 05:11:59 -0700 (PDT)
Raw View
------=_Part_1911_219556029.1534853519370
Content-Type: multipart/alternative;
boundary="----=_Part_1912_1345188627.1534853519371"
------=_Part_1912_1345188627.1534853519371
Content-Type: text/plain; charset="UTF-8"
Compilers can do compile time evaluation of functions since ages, even
before constexpr existed, mostly for optimization. There should be no
trouble implementing this feature. Right now there are formal rules if a
function can be constexpr. If it meets all of them, it should be one.
Before:
auto constexpr f() { return 5; }
auto g() { return 6; }
auto h()
{
auto v = vector<int>();
a.push_back(7);
return a[0];
}
template <int X>
class C {};
int main()
{
auto x = C<f()>(); // OK
auto y = C<g()>(); // compilation error
auto z = C<h()>(); // compilation error
}
After:
auto constexpr f() { return 5; }
auto g() { return 6; }
auto h()
{
auto v = vector<int>();
a.push_back(7);
return a[0];
}
template <int X>
class C {};
int main()
{
auto x = C<f()>(); // OK
auto y = C<g()>(); // OK, g is implicitly constexpr
auto z = C<h()>(); // compilation error
}
--
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/8de3edfa-f177-4dce-8127-45e928ae3f5d%40isocpp.org.
------=_Part_1912_1345188627.1534853519371
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Compilers can do compile time evaluation of functions=
since ages, even before constexpr existed, mostly for optimization. There =
should be no trouble implementing this feature. Right now there are formal =
rules if a function can be constexpr. If it meets all of them, it should be=
one.</div><div><br></div><div>Before:<br><br><div style=3D"background-colo=
r: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: soli=
d; border-width: 1px; overflow-wrap: break-word;" class=3D"prettyprint"><co=
de class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color=
: #008;" class=3D"styled-by-prettify">auto</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">constexpr</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> f</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">()</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> </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: #008;" class=3D"styled-by-prettify">return</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"=
color: #066;" class=3D"styled-by-prettify">5</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> </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: #008;" class=3D"styled-by-prettify"=
>auto</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> g</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">()</span><spa=
n 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"> </span><span style=3D"color: #008;" =
class=3D"styled-by-prettify">return</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> </span><span style=3D"color: #066;" class=3D"styl=
ed-by-prettify">6</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> <=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">}</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span sty=
le=3D"color: #008;" class=3D"styled-by-prettify">auto</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> h</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">()</span><span style=3D"color: #000;" cl=
ass=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-b=
y-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"=
styled-by-prettify">auto</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> v </span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
vector</span><span style=3D"color: #080;" class=3D"styled-by-prettify"><=
;int></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: #000;" class=3D"styled-by-prettify">push_ba=
ck</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span>=
<span style=3D"color: #066;" class=3D"styled-by-prettify">7</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">);</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span sty=
le=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"colo=
r: #660;" class=3D"styled-by-prettify">[</span><span style=3D"color: #066;"=
class=3D"styled-by-prettify">0</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-pre=
ttify">}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><b=
r><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify">temp=
late</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify"><</span><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">int</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> X</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">></span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" cl=
ass=3D"styled-by-prettify">class</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> C </span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">{};</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"><br><br></span><span style=3D"color: #008;" class=3D"styled-by-pr=
ettify">int</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> main</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><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><s=
pan style=3D"color: #008;" class=3D"styled-by-prettify">auto</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> x </span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> C</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify"><</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">f</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">()>();</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> </span><span style=3D"color: #800;" class=3D"styled-by-prett=
ify">// OK</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-pr=
ettify">auto</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> y </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> C</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify"><</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify">g</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">()>();</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #800;"=
class=3D"styled-by-prettify">// compilation error</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">auto</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> z </span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">=3D</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">h</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">()>();</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: #800;" class=3D"styled-by-prettify">// co=
mpilation error</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"><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=
></div></code></div><br><br>After:<br><br><div style=3D"background-color: r=
gb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; b=
order-width: 1px; overflow-wrap: break-word;" class=3D"prettyprint"><code c=
lass=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #0=
08;" class=3D"styled-by-prettify">auto</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"s=
tyled-by-prettify">constexpr</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> f</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;" class=3D"styled-by-prettify">{</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span st=
yle=3D"color: #008;" class=3D"styled-by-prettify">return</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #066;" class=3D"styled-by-prettify">5</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;" 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">auto=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> g</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">()</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> </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: #008;" class=
=3D"styled-by-prettify">return</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by=
-prettify">6</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;" class=3D"styled-by-prettify">}</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D=
"color: #008;" class=3D"styled-by-prettify">auto</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> h</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"st=
yled-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"sty=
led-by-prettify">auto</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> v </span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> ve=
ctor</span><span style=3D"color: #080;" class=3D"styled-by-prettify"><in=
t></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: #000;" class=3D"styled-by-prettify">push_back</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><spa=
n style=3D"color: #066;" class=3D"styled-by-prettify">7</span><span style=
=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 </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: #066;" cla=
ss=3D"styled-by-prettify">0</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">];</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"><br></span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><b=
r></span><span style=3D"color: #008;" class=3D"styled-by-prettify">template=
</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 st=
yle=3D"color: #008;" class=3D"styled-by-prettify">int</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> X</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">class</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> C </span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">{};</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"><br><br></span><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">int</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> mai=
n</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><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">auto</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> x </span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> C</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify"><</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify">f</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">()>();</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> </span><span style=3D"color: #800;" class=3D"styled-by-prettify">=
// OK</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-pretti=
fy">auto</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> y=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> C</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify"><</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">g</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: #800;" c=
lass=3D"styled-by-prettify">// OK, g is implicitly constexpr</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span>=
<span style=3D"color: #008;" class=3D"styled-by-prettify">auto</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> z </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> C</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify"><</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify">h</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">()>();</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> </span><span style=3D"color: #800;" class=3D"styled-by-pre=
ttify">// compilation error</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-prettify=
"><br></span></div></code></div><br><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/8de3edfa-f177-4dce-8127-45e928ae3f5d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/8de3edfa-f177-4dce-8127-45e928ae3f5d=
%40isocpp.org</a>.<br />
------=_Part_1912_1345188627.1534853519371--
------=_Part_1911_219556029.1534853519370--
.
Author: Richard Hodges <hodges.r@gmail.com>
Date: Tue, 21 Aug 2018 14:06:59 +0100
Raw View
--00000000000030a26e0573f1b40c
Content-Type: text/plain; charset="UTF-8"
On Tue, 21 Aug 2018 at 13:12, Dimitrij Mijoski <dim.mj.p@gmail.com> wrote:
> Compilers can do compile time evaluation of functions since ages, even
> before constexpr existed, mostly for optimization. There should be no
> trouble implementing this feature. Right now there are formal rules if a
> function can be constexpr. If it meets all of them, it should be one.
>
Difficult to argue against this IMHO, since lambdas are constexpr by
default as of c++17.
#include <vector>
auto constexpr f() { return 5; }
auto g = []() { return 6; };
auto h = []()
{
auto v = std::vector<int>();
v.push_back(7);
return v[0];
};
template <int X>
class C {};
int main()
{
auto x = C<f()>(); // OK
auto y = C<g()>(); // OK
// auto z = C<h()>(); // compilation error
}
>
> Before:
>
> auto constexpr f() { return 5; }
> auto g() { return 6; }
> auto h()
> {
> auto v = vector<int>();
> a.push_back(7);
> return a[0];
> }
>
> template <int X>
> class C {};
>
> int main()
> {
> auto x = C<f()>(); // OK
> auto y = C<g()>(); // compilation error
> auto z = C<h()>(); // compilation error
> }
>
>
> After:
>
> auto constexpr f() { return 5; }
> auto g() { return 6; }
> auto h()
> {
> auto v = vector<int>();
> a.push_back(7);
> return a[0];
> }
>
> template <int X>
> class C {};
>
> int main()
> {
> auto x = C<f()>(); // OK
> auto y = C<g()>(); // OK, g is implicitly constexpr
> auto z = C<h()>(); // compilation error
> }
>
>
> --
> 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/8de3edfa-f177-4dce-8127-45e928ae3f5d%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/8de3edfa-f177-4dce-8127-45e928ae3f5d%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
--
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/CALvx3hZLnda%2BN_RhLw2qDHFbeuGyu8tnXC8-W6VruW8XxZxfNA%40mail.gmail.com.
--00000000000030a26e0573f1b40c
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Tue=
, 21 Aug 2018 at 13:12, Dimitrij Mijoski <<a href=3D"mailto:dim.mj.p@gma=
il.com">dim.mj.p@gmail.com</a>> wrote:<br></div><blockquote class=3D"gma=
il_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,2=
04,204);padding-left:1ex"><div dir=3D"ltr"><div>Compilers can do compile ti=
me evaluation of functions since ages, even before constexpr existed, mostl=
y for optimization. There should be no trouble implementing this feature. R=
ight now there are formal rules if a function can be constexpr. If it meets=
all of them, it should be one.</div></div></blockquote><div><br></div><div=
>Difficult to argue against this IMHO, since lambdas are constexpr by defau=
lt as of c++17.</div><div><br></div><div><div><font face=3D"monospace, mono=
space">#include <vector></font></div><div><font face=3D"monospace, mo=
nospace"><br></font></div><div><font face=3D"monospace, monospace">auto con=
stexpr f() { return 5; }</font></div><div><font face=3D"monospace, monospac=
e">auto g =3D []() { return 6; };</font></div><div><font face=3D"monospace,=
monospace">auto h =3D []()</font></div><div><font face=3D"monospace, monos=
pace">{</font></div><div><font face=3D"monospace, monospace">=C2=A0 =C2=A0 =
auto v =3D std::vector<int>();</font></div><div><font face=3D"monospa=
ce, monospace">=C2=A0 =C2=A0 v.push_back(7);</font></div><div><font face=3D=
"monospace, monospace">=C2=A0 =C2=A0 return v[0];</font></div><div><font fa=
ce=3D"monospace, monospace">};</font></div><div><font face=3D"monospace, mo=
nospace"><br></font></div><div><font face=3D"monospace, monospace">template=
<int X></font></div><div><font face=3D"monospace, monospace">class C=
{};</font></div><div><font face=3D"monospace, monospace"><br></font></div>=
<div><font face=3D"monospace, monospace">int main()</font></div><div><font =
face=3D"monospace, monospace">{</font></div><div><font face=3D"monospace, m=
onospace">=C2=A0 =C2=A0 auto x =3D C<f()>(); // OK</font></div><div><=
font face=3D"monospace, monospace">=C2=A0 =C2=A0 auto y =3D C<g()>();=
// OK</font></div><div><font face=3D"monospace, monospace">//=C2=A0 =C2=A0=
auto z =3D C<h()>(); // compilation error</font></div><div><font fac=
e=3D"monospace, monospace">}</font></div></div><div><br></div><div>=C2=A0</=
div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bor=
der-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div=
><br></div><div>Before:<br><br><div style=3D"background-color:rgb(250,250,2=
50);border-color:rgb(187,187,187);border-style:solid;border-width:1px" clas=
s=3D"gmail-m_-3526040043261261328prettyprint"><code class=3D"gmail-m_-35260=
40043261261328prettyprint"><div class=3D"gmail-m_-3526040043261261328subpre=
ttyprint"><span style=3D"color:rgb(0,0,136)" class=3D"gmail-m_-352604004326=
1261328styled-by-prettify">auto</span><span style=3D"color:rgb(0,0,0)" clas=
s=3D"gmail-m_-3526040043261261328styled-by-prettify"> </span><span style=3D=
"color:rgb(0,0,136)" class=3D"gmail-m_-3526040043261261328styled-by-prettif=
y">constexpr</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-35260=
40043261261328styled-by-prettify"> f</span><span style=3D"color:rgb(102,102=
,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">()</span><spa=
n style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by=
-prettify"> </span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3=
526040043261261328styled-by-prettify">{</span><span style=3D"color:rgb(0,0,=
0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"> </span><span =
style=3D"color:rgb(0,0,136)" class=3D"gmail-m_-3526040043261261328styled-by=
-prettify">return</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-=
3526040043261261328styled-by-prettify"> </span><span style=3D"color:rgb(0,1=
02,102)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">5</span><=
span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261328st=
yled-by-prettify">;</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m=
_-3526040043261261328styled-by-prettify"> </span><span style=3D"color:rgb(1=
02,102,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">}</span=
><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styl=
ed-by-prettify"><br></span><span style=3D"color:rgb(0,0,136)" class=3D"gmai=
l-m_-3526040043261261328styled-by-prettify">auto</span><span style=3D"color=
:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"> g</s=
pan><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261=
328styled-by-prettify">()</span><span style=3D"color:rgb(0,0,0)" class=3D"g=
mail-m_-3526040043261261328styled-by-prettify"> </span><span style=3D"color=
:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">{=
</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-35260400432612613=
28styled-by-prettify"> </span><span style=3D"color:rgb(0,0,136)" class=3D"g=
mail-m_-3526040043261261328styled-by-prettify">return</span><span style=3D"=
color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">=
</span><span style=3D"color:rgb(0,102,102)" class=3D"gmail-m_-352604004326=
1261328styled-by-prettify">6</span><span style=3D"color:rgb(102,102,0)" cla=
ss=3D"gmail-m_-3526040043261261328styled-by-prettify">;</span><span style=
=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-pretti=
fy"> </span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-35260400=
43261261328styled-by-prettify">}</span><span style=3D"color:rgb(0,0,0)" cla=
ss=3D"gmail-m_-3526040043261261328styled-by-prettify"><br></span><span styl=
e=3D"color:rgb(0,0,136)" class=3D"gmail-m_-3526040043261261328styled-by-pre=
ttify">auto</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-352604=
0043261261328styled-by-prettify"> h</span><span style=3D"color:rgb(102,102,=
0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">()</span><span=
style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-=
prettify"><br></span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_=
-3526040043261261328styled-by-prettify">{</span><span style=3D"color:rgb(0,=
0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"><br>=C2=A0 =
=C2=A0 </span><span style=3D"color:rgb(0,0,136)" class=3D"gmail-m_-35260400=
43261261328styled-by-prettify">auto</span><span style=3D"color:rgb(0,0,0)" =
class=3D"gmail-m_-3526040043261261328styled-by-prettify"> v </span><span st=
yle=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261328styled-by=
-prettify">=3D</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-352=
6040043261261328styled-by-prettify"> vector</span><span style=3D"color:rgb(=
0,136,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"><int&=
gt;</span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526040043=
261261328styled-by-prettify">();</span><span style=3D"color:rgb(0,0,0)" cla=
ss=3D"gmail-m_-3526040043261261328styled-by-prettify"><br>=C2=A0 =C2=A0 a</=
span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-352604004326126=
1328styled-by-prettify">.</span><span style=3D"color:rgb(0,0,0)" class=3D"g=
mail-m_-3526040043261261328styled-by-prettify">push_back</span><span style=
=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261328styled-by-pr=
ettify">(</span><span style=3D"color:rgb(0,102,102)" class=3D"gmail-m_-3526=
040043261261328styled-by-prettify">7</span><span style=3D"color:rgb(102,102=
,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">);</span><spa=
n style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by=
-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color:rgb(0,0,136)" clas=
s=3D"gmail-m_-3526040043261261328styled-by-prettify">return</span><span sty=
le=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-pret=
tify"> a</span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-35260=
40043261261328styled-by-prettify">[</span><span style=3D"color:rgb(0,102,10=
2)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">0</span><span =
style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261328styled-=
by-prettify">];</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-35=
26040043261261328styled-by-prettify"><br></span><span style=3D"color:rgb(10=
2,102,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">}</span>=
<span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328style=
d-by-prettify"><br><br></span><span style=3D"color:rgb(0,0,136)" class=3D"g=
mail-m_-3526040043261261328styled-by-prettify">template</span><span style=
=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-pretti=
fy"> </span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-35260400=
43261261328styled-by-prettify"><</span><span style=3D"color:rgb(0,0,136)=
" class=3D"gmail-m_-3526040043261261328styled-by-prettify">int</span><span =
style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-p=
rettify"> X</span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-35=
26040043261261328styled-by-prettify">></span><span style=3D"color:rgb(0,=
0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"><br></span><=
span style=3D"color:rgb(0,0,136)" class=3D"gmail-m_-3526040043261261328styl=
ed-by-prettify">class</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail=
-m_-3526040043261261328styled-by-prettify"> C </span><span style=3D"color:r=
gb(102,102,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">{};=
</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-35260400432612613=
28styled-by-prettify"><br><br></span><span style=3D"color:rgb(0,0,136)" cla=
ss=3D"gmail-m_-3526040043261261328styled-by-prettify">int</span><span style=
=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-pretti=
fy"> main</span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526=
040043261261328styled-by-prettify">()</span><span style=3D"color:rgb(0,0,0)=
" class=3D"gmail-m_-3526040043261261328styled-by-prettify"><br></span><span=
style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261328styled=
-by-prettify">{</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-35=
26040043261261328styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=
=3D"color:rgb(0,0,136)" class=3D"gmail-m_-3526040043261261328styled-by-pret=
tify">auto</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040=
043261261328styled-by-prettify"> x </span><span style=3D"color:rgb(102,102,=
0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">=3D</span><spa=
n style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by=
-prettify"> C</span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-=
3526040043261261328styled-by-prettify"><</span><span style=3D"color:rgb(=
0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">f</span><s=
pan style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261328sty=
led-by-prettify">()>();</span><span style=3D"color:rgb(0,0,0)" class=3D"=
gmail-m_-3526040043261261328styled-by-prettify"> </span><span style=3D"colo=
r:rgb(136,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">//=
OK</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-35260400432612=
61328styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color:rgb(=
0,0,136)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">auto</sp=
an><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328st=
yled-by-prettify"> y </span><span style=3D"color:rgb(102,102,0)" class=3D"g=
mail-m_-3526040043261261328styled-by-prettify">=3D</span><span style=3D"col=
or:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"> C<=
/span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-35260400432612=
61328styled-by-prettify"><</span><span style=3D"color:rgb(0,0,0)" class=
=3D"gmail-m_-3526040043261261328styled-by-prettify">g</span><span style=3D"=
color:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261328styled-by-pretti=
fy">()>();</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526=
040043261261328styled-by-prettify"> </span><span style=3D"color:rgb(136,0,0=
)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">// compilation =
error</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-352604004326=
1261328styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color:rg=
b(0,0,136)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">auto</=
span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328=
styled-by-prettify"> z </span><span style=3D"color:rgb(102,102,0)" class=3D=
"gmail-m_-3526040043261261328styled-by-prettify">=3D</span><span style=3D"c=
olor:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"> =
C</span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-352604004326=
1261328styled-by-prettify"><</span><span style=3D"color:rgb(0,0,0)" clas=
s=3D"gmail-m_-3526040043261261328styled-by-prettify">h</span><span style=3D=
"color:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261328styled-by-prett=
ify">()>();</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-352=
6040043261261328styled-by-prettify"> </span><span style=3D"color:rgb(136,0,=
0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">// compilation=
error</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-35260400432=
61261328styled-by-prettify"><br></span><span style=3D"color:rgb(102,102,0)"=
class=3D"gmail-m_-3526040043261261328styled-by-prettify">}</span><span sty=
le=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-pret=
tify"><br></span></div></code></div><br><br>After:<br><br><div style=3D"bac=
kground-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:s=
olid;border-width:1px" class=3D"gmail-m_-3526040043261261328prettyprint"><c=
ode class=3D"gmail-m_-3526040043261261328prettyprint"><div class=3D"gmail-m=
_-3526040043261261328subprettyprint"><span style=3D"color:rgb(0,0,136)" cla=
ss=3D"gmail-m_-3526040043261261328styled-by-prettify">auto</span><span styl=
e=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prett=
ify"> </span><span style=3D"color:rgb(0,0,136)" class=3D"gmail-m_-352604004=
3261261328styled-by-prettify">constexpr</span><span style=3D"color:rgb(0,0,=
0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"> f</span><span=
style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261328styled=
-by-prettify">()</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3=
526040043261261328styled-by-prettify"> </span><span style=3D"color:rgb(102,=
102,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">{</span><s=
pan style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-=
by-prettify"> </span><span style=3D"color:rgb(0,0,136)" class=3D"gmail-m_-3=
526040043261261328styled-by-prettify">return</span><span style=3D"color:rgb=
(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"> </span><=
span style=3D"color:rgb(0,102,102)" class=3D"gmail-m_-3526040043261261328st=
yled-by-prettify">5</span><span style=3D"color:rgb(102,102,0)" class=3D"gma=
il-m_-3526040043261261328styled-by-prettify">;</span><span style=3D"color:r=
gb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"> </span=
><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261328=
styled-by-prettify">}</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail=
-m_-3526040043261261328styled-by-prettify"><br></span><span style=3D"color:=
rgb(0,0,136)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">auto=
</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-35260400432612613=
28styled-by-prettify"> g</span><span style=3D"color:rgb(102,102,0)" class=
=3D"gmail-m_-3526040043261261328styled-by-prettify">()</span><span style=3D=
"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"=
> </span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-35260400432=
61261328styled-by-prettify">{</span><span style=3D"color:rgb(0,0,0)" class=
=3D"gmail-m_-3526040043261261328styled-by-prettify"> </span><span style=3D"=
color:rgb(0,0,136)" class=3D"gmail-m_-3526040043261261328styled-by-prettify=
">return</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-352604004=
3261261328styled-by-prettify"> </span><span style=3D"color:rgb(0,102,102)" =
class=3D"gmail-m_-3526040043261261328styled-by-prettify">6</span><span styl=
e=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261328styled-by-p=
rettify">;</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040=
043261261328styled-by-prettify"> </span><span style=3D"color:rgb(102,102,0)=
" class=3D"gmail-m_-3526040043261261328styled-by-prettify">}</span><span st=
yle=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-pre=
ttify"><br></span><span style=3D"color:rgb(0,0,136)" class=3D"gmail-m_-3526=
040043261261328styled-by-prettify">auto</span><span style=3D"color:rgb(0,0,=
0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"> h</span><span=
style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261328styled=
-by-prettify">()</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3=
526040043261261328styled-by-prettify"><br></span><span style=3D"color:rgb(1=
02,102,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">{</span=
><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styl=
ed-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color:rgb(0,0,136)"=
class=3D"gmail-m_-3526040043261261328styled-by-prettify">auto</span><span =
style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-p=
rettify"> v </span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3=
526040043261261328styled-by-prettify">=3D</span><span style=3D"color:rgb(0,=
0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"> vector</spa=
n><span style=3D"color:rgb(0,136,0)" class=3D"gmail-m_-3526040043261261328s=
tyled-by-prettify"><int></span><span style=3D"color:rgb(102,102,0)" c=
lass=3D"gmail-m_-3526040043261261328styled-by-prettify">();</span><span sty=
le=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-pret=
tify"><br>=C2=A0 =C2=A0 a</span><span style=3D"color:rgb(102,102,0)" class=
=3D"gmail-m_-3526040043261261328styled-by-prettify">.</span><span style=3D"=
color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">=
push_back</span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526=
040043261261328styled-by-prettify">(</span><span style=3D"color:rgb(0,102,1=
02)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">7</span><span=
style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261328styled=
-by-prettify">);</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3=
526040043261261328styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=
=3D"color:rgb(0,0,136)" class=3D"gmail-m_-3526040043261261328styled-by-pret=
tify">return</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-35260=
40043261261328styled-by-prettify"> a</span><span style=3D"color:rgb(102,102=
,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">[</span><span=
style=3D"color:rgb(0,102,102)" class=3D"gmail-m_-3526040043261261328styled=
-by-prettify">0</span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m=
_-3526040043261261328styled-by-prettify">];</span><span style=3D"color:rgb(=
0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"><br></span=
><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261328=
styled-by-prettify">}</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail=
-m_-3526040043261261328styled-by-prettify"><br><br></span><span style=3D"co=
lor:rgb(0,0,136)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">=
template</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-352604004=
3261261328styled-by-prettify"> </span><span style=3D"color:rgb(102,102,0)" =
class=3D"gmail-m_-3526040043261261328styled-by-prettify"><</span><span s=
tyle=3D"color:rgb(0,0,136)" class=3D"gmail-m_-3526040043261261328styled-by-=
prettify">int</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526=
040043261261328styled-by-prettify"> X</span><span style=3D"color:rgb(102,10=
2,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">></span><=
span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled=
-by-prettify"><br></span><span style=3D"color:rgb(0,0,136)" class=3D"gmail-=
m_-3526040043261261328styled-by-prettify">class</span><span style=3D"color:=
rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"> C </s=
pan><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261=
328styled-by-prettify">{};</span><span style=3D"color:rgb(0,0,0)" class=3D"=
gmail-m_-3526040043261261328styled-by-prettify"><br><br></span><span style=
=3D"color:rgb(0,0,136)" class=3D"gmail-m_-3526040043261261328styled-by-pret=
tify">int</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-35260400=
43261261328styled-by-prettify"> main</span><span style=3D"color:rgb(102,102=
,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">()</span><spa=
n style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by=
-prettify"><br></span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m=
_-3526040043261261328styled-by-prettify">{</span><span style=3D"color:rgb(0=
,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"><br>=C2=A0 =
=C2=A0 </span><span style=3D"color:rgb(0,0,136)" class=3D"gmail-m_-35260400=
43261261328styled-by-prettify">auto</span><span style=3D"color:rgb(0,0,0)" =
class=3D"gmail-m_-3526040043261261328styled-by-prettify"> x </span><span st=
yle=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261328styled-by=
-prettify">=3D</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-352=
6040043261261328styled-by-prettify"> C</span><span style=3D"color:rgb(102,1=
02,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"><</span>=
<span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328style=
d-by-prettify">f</span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-=
m_-3526040043261261328styled-by-prettify">()>();</span><span style=3D"co=
lor:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"> <=
/span><span style=3D"color:rgb(136,0,0)" class=3D"gmail-m_-3526040043261261=
328styled-by-prettify">// OK</span><span style=3D"color:rgb(0,0,0)" class=
=3D"gmail-m_-3526040043261261328styled-by-prettify"><br>=C2=A0 =C2=A0 </spa=
n><span style=3D"color:rgb(0,0,136)" class=3D"gmail-m_-3526040043261261328s=
tyled-by-prettify">auto</span><span style=3D"color:rgb(0,0,0)" class=3D"gma=
il-m_-3526040043261261328styled-by-prettify"> y </span><span style=3D"color=
:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify">=
=3D</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-35260400432612=
61328styled-by-prettify"> C</span><span style=3D"color:rgb(102,102,0)" clas=
s=3D"gmail-m_-3526040043261261328styled-by-prettify"><</span><span style=
=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-pretti=
fy">g</span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-35260400=
43261261328styled-by-prettify">()>();</span><span style=3D"color:rgb(0,0=
,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"> </span><span=
style=3D"color:rgb(136,0,0)" class=3D"gmail-m_-3526040043261261328styled-b=
y-prettify">// OK, g is implicitly constexpr</span><span style=3D"color:rgb=
(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"><br>=C2=
=A0 =C2=A0 </span><span style=3D"color:rgb(0,0,136)" class=3D"gmail-m_-3526=
040043261261328styled-by-prettify">auto</span><span style=3D"color:rgb(0,0,=
0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"> z </span><spa=
n style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526040043261261328style=
d-by-prettify">=3D</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_=
-3526040043261261328styled-by-prettify"> C</span><span style=3D"color:rgb(1=
02,102,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"><</s=
pan><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328s=
tyled-by-prettify">h</span><span style=3D"color:rgb(102,102,0)" class=3D"gm=
ail-m_-3526040043261261328styled-by-prettify">()>();</span><span style=
=3D"color:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-pretti=
fy"> </span><span style=3D"color:rgb(136,0,0)" class=3D"gmail-m_-3526040043=
261261328styled-by-prettify">// compilation error</span><span style=3D"colo=
r:rgb(0,0,0)" class=3D"gmail-m_-3526040043261261328styled-by-prettify"><br>=
</span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-3526040043261=
261328styled-by-prettify">}</span><span style=3D"color:rgb(0,0,0)" class=3D=
"gmail-m_-3526040043261261328styled-by-prettify"><br></span></div></code></=
div><br><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" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">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/8de3edfa-f177-4dce-8127-45e928ae3f5d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/8de3edfa-f177-=
4dce-8127-45e928ae3f5d%40isocpp.org</a>.<br>
</blockquote></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/CALvx3hZLnda%2BN_RhLw2qDHFbeuGyu8tnXC=
8-W6VruW8XxZxfNA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALvx3hZLnda%2B=
N_RhLw2qDHFbeuGyu8tnXC8-W6VruW8XxZxfNA%40mail.gmail.com</a>.<br />
--00000000000030a26e0573f1b40c--
.
Author: Phil Miller <unmobile@gmail.com>
Date: Tue, 21 Aug 2018 08:12:29 -0500
Raw View
--000000000000dce1e40573f1c740
Content-Type: text/plain; charset="UTF-8"
This potentially creates problems for API stability. A published function
marked as constexpr would have to stay constexpr. One that the compiler
infers as constexpr and gets used as such could be broken in a later
version, causing calling code to fail to compile or to silently degrade in
performance.
On Tue, Aug 21, 2018, 8:07 AM Richard Hodges <hodges.r@gmail.com> wrote:
>
>
> On Tue, 21 Aug 2018 at 13:12, Dimitrij Mijoski <dim.mj.p@gmail.com> wrote:
>
>> Compilers can do compile time evaluation of functions since ages, even
>> before constexpr existed, mostly for optimization. There should be no
>> trouble implementing this feature. Right now there are formal rules if a
>> function can be constexpr. If it meets all of them, it should be one.
>>
>
> Difficult to argue against this IMHO, since lambdas are constexpr by
> default as of c++17.
>
> #include <vector>
>
> auto constexpr f() { return 5; }
> auto g = []() { return 6; };
> auto h = []()
> {
> auto v = std::vector<int>();
> v.push_back(7);
> return v[0];
> };
>
> template <int X>
> class C {};
>
> int main()
> {
> auto x = C<f()>(); // OK
> auto y = C<g()>(); // OK
> // auto z = C<h()>(); // compilation error
> }
>
>
>
>>
>> Before:
>>
>> auto constexpr f() { return 5; }
>> auto g() { return 6; }
>> auto h()
>> {
>> auto v = vector<int>();
>> a.push_back(7);
>> return a[0];
>> }
>>
>> template <int X>
>> class C {};
>>
>> int main()
>> {
>> auto x = C<f()>(); // OK
>> auto y = C<g()>(); // compilation error
>> auto z = C<h()>(); // compilation error
>> }
>>
>>
>> After:
>>
>> auto constexpr f() { return 5; }
>> auto g() { return 6; }
>> auto h()
>> {
>> auto v = vector<int>();
>> a.push_back(7);
>> return a[0];
>> }
>>
>> template <int X>
>> class C {};
>>
>> int main()
>> {
>> auto x = C<f()>(); // OK
>> auto y = C<g()>(); // OK, g is implicitly constexpr
>> auto z = C<h()>(); // compilation error
>> }
>>
>>
>> --
>> 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/8de3edfa-f177-4dce-8127-45e928ae3f5d%40isocpp.org
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/8de3edfa-f177-4dce-8127-45e928ae3f5d%40isocpp.org?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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/CALvx3hZLnda%2BN_RhLw2qDHFbeuGyu8tnXC8-W6VruW8XxZxfNA%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALvx3hZLnda%2BN_RhLw2qDHFbeuGyu8tnXC8-W6VruW8XxZxfNA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
--
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/CAMDbWJHVh9XoDqwzAAsHjP%3DO%3DGs7%3Dw9u6n2tZOXnOMy7Hp%2BNrw%40mail.gmail.com.
--000000000000dce1e40573f1c740
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"auto">This potentially creates problems for API stability. A pu=
blished function marked as constexpr would have to stay constexpr. One that=
the compiler infers as constexpr and gets used as such could be broken in =
a later version, causing calling code to fail to compile or to silently deg=
rade in performance.</div><br><div class=3D"gmail_quote"><div dir=3D"ltr">O=
n Tue, Aug 21, 2018, 8:07 AM Richard Hodges <<a href=3D"mailto:hodges.r@=
gmail.com">hodges.r@gmail.com</a>> wrote:<br></div><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex"><div dir=3D"ltr"><br><br><div class=3D"gmail_quote"><div dir=3D"l=
tr">On Tue, 21 Aug 2018 at 13:12, Dimitrij Mijoski <<a href=3D"mailto:di=
m.mj.p@gmail.com" target=3D"_blank" rel=3D"noreferrer">dim.mj.p@gmail.com</=
a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0p=
x 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><d=
iv dir=3D"ltr"><div>Compilers can do compile time evaluation of functions s=
ince ages, even before constexpr existed, mostly for optimization. There sh=
ould be no trouble implementing this feature. Right now there are formal ru=
les if a function can be constexpr. If it meets all of them, it should be o=
ne.</div></div></blockquote><div><br></div><div>Difficult to argue against =
this IMHO, since lambdas are constexpr by default as of c++17.</div><div><b=
r></div><div><div><font face=3D"monospace, monospace">#include <vector&g=
t;</font></div><div><font face=3D"monospace, monospace"><br></font></div><d=
iv><font face=3D"monospace, monospace">auto constexpr f() { return 5; }</fo=
nt></div><div><font face=3D"monospace, monospace">auto g =3D []() { return =
6; };</font></div><div><font face=3D"monospace, monospace">auto h =3D []()<=
/font></div><div><font face=3D"monospace, monospace">{</font></div><div><fo=
nt face=3D"monospace, monospace">=C2=A0 =C2=A0 auto v =3D std::vector<in=
t>();</font></div><div><font face=3D"monospace, monospace">=C2=A0 =C2=A0=
v.push_back(7);</font></div><div><font face=3D"monospace, monospace">=C2=
=A0 =C2=A0 return v[0];</font></div><div><font face=3D"monospace, monospace=
">};</font></div><div><font face=3D"monospace, monospace"><br></font></div>=
<div><font face=3D"monospace, monospace">template <int X></font></div=
><div><font face=3D"monospace, monospace">class C {};</font></div><div><fon=
t face=3D"monospace, monospace"><br></font></div><div><font face=3D"monospa=
ce, monospace">int main()</font></div><div><font face=3D"monospace, monospa=
ce">{</font></div><div><font face=3D"monospace, monospace">=C2=A0 =C2=A0 au=
to x =3D C<f()>(); // OK</font></div><div><font face=3D"monospace, mo=
nospace">=C2=A0 =C2=A0 auto y =3D C<g()>(); // OK</font></div><div><f=
ont face=3D"monospace, monospace">//=C2=A0 =C2=A0 auto z =3D C<h()>()=
; // compilation error</font></div><div><font face=3D"monospace, monospace"=
>}</font></div></div><div><br></div><div>=C2=A0</div><blockquote class=3D"g=
mail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204=
,204,204);padding-left:1ex"><div dir=3D"ltr"><div><br></div><div>Before:<br=
><br><div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,1=
87,187);border-style:solid;border-width:1px" class=3D"m_-496514069295391188=
0gmail-m_-3526040043261261328prettyprint"><code class=3D"m_-496514069295391=
1880gmail-m_-3526040043261261328prettyprint"><div class=3D"m_-4965140692953=
911880gmail-m_-3526040043261261328subprettyprint"><span style=3D"color:rgb(=
0,0,136)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled=
-by-prettify">auto</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-49651=
40692953911880gmail-m_-3526040043261261328styled-by-prettify"> </span><span=
style=3D"color:rgb(0,0,136)" class=3D"m_-4965140692953911880gmail-m_-35260=
40043261261328styled-by-prettify">constexpr</span><span style=3D"color:rgb(=
0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-b=
y-prettify"> f</span><span style=3D"color:rgb(102,102,0)" class=3D"m_-49651=
40692953911880gmail-m_-3526040043261261328styled-by-prettify">()</span><spa=
n style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-352604=
0043261261328styled-by-prettify"> </span><span style=3D"color:rgb(102,102,0=
)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-pre=
ttify">{</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-496514069295391=
1880gmail-m_-3526040043261261328styled-by-prettify"> </span><span style=3D"=
color:rgb(0,0,136)" class=3D"m_-4965140692953911880gmail-m_-352604004326126=
1328styled-by-prettify">return</span><span style=3D"color:rgb(0,0,0)" class=
=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify"> =
</span><span style=3D"color:rgb(0,102,102)" class=3D"m_-4965140692953911880=
gmail-m_-3526040043261261328styled-by-prettify">5</span><span style=3D"colo=
r:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-35260400432612613=
28styled-by-prettify">;</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-=
4965140692953911880gmail-m_-3526040043261261328styled-by-prettify"> </span>=
<span style=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m=
_-3526040043261261328styled-by-prettify">}</span><span style=3D"color:rgb(0=
,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by=
-prettify"><br></span><span style=3D"color:rgb(0,0,136)" class=3D"m_-496514=
0692953911880gmail-m_-3526040043261261328styled-by-prettify">auto</span><sp=
an style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-35260=
40043261261328styled-by-prettify"> g</span><span style=3D"color:rgb(102,102=
,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-p=
rettify">()</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-496514069295=
3911880gmail-m_-3526040043261261328styled-by-prettify"> </span><span style=
=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-352604004=
3261261328styled-by-prettify">{</span><span style=3D"color:rgb(0,0,0)" clas=
s=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify">=
</span><span style=3D"color:rgb(0,0,136)" class=3D"m_-4965140692953911880g=
mail-m_-3526040043261261328styled-by-prettify">return</span><span style=3D"=
color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-35260400432612613=
28styled-by-prettify"> </span><span style=3D"color:rgb(0,102,102)" class=3D=
"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify">6</s=
pan><span style=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gma=
il-m_-3526040043261261328styled-by-prettify">;</span><span style=3D"color:r=
gb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328style=
d-by-prettify"> </span><span style=3D"color:rgb(102,102,0)" class=3D"m_-496=
5140692953911880gmail-m_-3526040043261261328styled-by-prettify">}</span><sp=
an style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-35260=
40043261261328styled-by-prettify"><br></span><span style=3D"color:rgb(0,0,1=
36)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-p=
rettify">auto</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692=
953911880gmail-m_-3526040043261261328styled-by-prettify"> h</span><span sty=
le=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-3526040=
043261261328styled-by-prettify">()</span><span style=3D"color:rgb(0,0,0)" c=
lass=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettif=
y"><br></span><span style=3D"color:rgb(102,102,0)" class=3D"m_-496514069295=
3911880gmail-m_-3526040043261261328styled-by-prettify">{</span><span style=
=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261=
261328styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color:rgb=
(0,0,136)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328style=
d-by-prettify">auto</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-4965=
140692953911880gmail-m_-3526040043261261328styled-by-prettify"> v </span><s=
pan style=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-=
3526040043261261328styled-by-prettify">=3D</span><span style=3D"color:rgb(0=
,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by=
-prettify"> vector</span><span style=3D"color:rgb(0,136,0)" class=3D"m_-496=
5140692953911880gmail-m_-3526040043261261328styled-by-prettify"><int>=
</span><span style=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880=
gmail-m_-3526040043261261328styled-by-prettify">();</span><span style=3D"co=
lor:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328=
styled-by-prettify"><br>=C2=A0 =C2=A0 a</span><span style=3D"color:rgb(102,=
102,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-b=
y-prettify">.</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692=
953911880gmail-m_-3526040043261261328styled-by-prettify">push_back</span><s=
pan style=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-=
3526040043261261328styled-by-prettify">(</span><span style=3D"color:rgb(0,1=
02,102)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-=
by-prettify">7</span><span style=3D"color:rgb(102,102,0)" class=3D"m_-49651=
40692953911880gmail-m_-3526040043261261328styled-by-prettify">);</span><spa=
n style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-352604=
0043261261328styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"co=
lor:rgb(0,0,136)" class=3D"m_-4965140692953911880gmail-m_-35260400432612613=
28styled-by-prettify">return</span><span style=3D"color:rgb(0,0,0)" class=
=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify"> =
a</span><span style=3D"color:rgb(102,102,0)" class=3D"m_-496514069295391188=
0gmail-m_-3526040043261261328styled-by-prettify">[</span><span style=3D"col=
or:rgb(0,102,102)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261=
328styled-by-prettify">0</span><span style=3D"color:rgb(102,102,0)" class=
=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify">]=
;</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gma=
il-m_-3526040043261261328styled-by-prettify"><br></span><span style=3D"colo=
r:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-35260400432612613=
28styled-by-prettify">}</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-=
4965140692953911880gmail-m_-3526040043261261328styled-by-prettify"><br><br>=
</span><span style=3D"color:rgb(0,0,136)" class=3D"m_-4965140692953911880gm=
ail-m_-3526040043261261328styled-by-prettify">template</span><span style=3D=
"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261=
328styled-by-prettify"> </span><span style=3D"color:rgb(102,102,0)" class=
=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify">&=
lt;</span><span style=3D"color:rgb(0,0,136)" class=3D"m_-496514069295391188=
0gmail-m_-3526040043261261328styled-by-prettify">int</span><span style=3D"c=
olor:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-352604004326126132=
8styled-by-prettify"> X</span><span style=3D"color:rgb(102,102,0)" class=3D=
"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify">>=
</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmai=
l-m_-3526040043261261328styled-by-prettify"><br></span><span style=3D"color=
:rgb(0,0,136)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328s=
tyled-by-prettify">class</span><span style=3D"color:rgb(0,0,0)" class=3D"m_=
-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify"> C </sp=
an><span style=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmai=
l-m_-3526040043261261328styled-by-prettify">{};</span><span style=3D"color:=
rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styl=
ed-by-prettify"><br><br></span><span style=3D"color:rgb(0,0,136)" class=3D"=
m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify">int</=
span><span style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-=
m_-3526040043261261328styled-by-prettify"> main</span><span style=3D"color:=
rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328=
styled-by-prettify">()</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-4=
965140692953911880gmail-m_-3526040043261261328styled-by-prettify"><br></spa=
n><span style=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail=
-m_-3526040043261261328styled-by-prettify">{</span><span style=3D"color:rgb=
(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-=
by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color:rgb(0,0,136)" cl=
ass=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify=
">auto</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-49651406929539118=
80gmail-m_-3526040043261261328styled-by-prettify"> x </span><span style=3D"=
color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261=
261328styled-by-prettify">=3D</span><span style=3D"color:rgb(0,0,0)" class=
=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify"> =
C</span><span style=3D"color:rgb(102,102,0)" class=3D"m_-496514069295391188=
0gmail-m_-3526040043261261328styled-by-prettify"><</span><span style=3D"=
color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-35260400432612613=
28styled-by-prettify">f</span><span style=3D"color:rgb(102,102,0)" class=3D=
"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify">()&g=
t;();</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-496514069295391188=
0gmail-m_-3526040043261261328styled-by-prettify"> </span><span style=3D"col=
or:rgb(136,0,0)" class=3D"m_-4965140692953911880gmail-m_-352604004326126132=
8styled-by-prettify">// OK</span><span style=3D"color:rgb(0,0,0)" class=3D"=
m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify"><br>=
=C2=A0 =C2=A0 </span><span style=3D"color:rgb(0,0,136)" class=3D"m_-4965140=
692953911880gmail-m_-3526040043261261328styled-by-prettify">auto</span><spa=
n style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-352604=
0043261261328styled-by-prettify"> y </span><span style=3D"color:rgb(102,102=
,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-p=
rettify">=3D</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-49651406929=
53911880gmail-m_-3526040043261261328styled-by-prettify"> C</span><span styl=
e=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-35260400=
43261261328styled-by-prettify"><</span><span style=3D"color:rgb(0,0,0)" =
class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-pretti=
fy">g</span><span style=3D"color:rgb(102,102,0)" class=3D"m_-49651406929539=
11880gmail-m_-3526040043261261328styled-by-prettify">()>();</span><span =
style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-35260400=
43261261328styled-by-prettify"> </span><span style=3D"color:rgb(136,0,0)" c=
lass=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettif=
y">// compilation error</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-=
4965140692953911880gmail-m_-3526040043261261328styled-by-prettify"><br>=C2=
=A0 =C2=A0 </span><span style=3D"color:rgb(0,0,136)" class=3D"m_-4965140692=
953911880gmail-m_-3526040043261261328styled-by-prettify">auto</span><span s=
tyle=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-352604004=
3261261328styled-by-prettify"> z </span><span style=3D"color:rgb(102,102,0)=
" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-pret=
tify">=3D</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-49651406929539=
11880gmail-m_-3526040043261261328styled-by-prettify"> C</span><span style=
=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-352604004=
3261261328styled-by-prettify"><</span><span style=3D"color:rgb(0,0,0)" c=
lass=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettif=
y">h</span><span style=3D"color:rgb(102,102,0)" class=3D"m_-496514069295391=
1880gmail-m_-3526040043261261328styled-by-prettify">()>();</span><span s=
tyle=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-352604004=
3261261328styled-by-prettify"> </span><span style=3D"color:rgb(136,0,0)" cl=
ass=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify=
">// compilation error</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-4=
965140692953911880gmail-m_-3526040043261261328styled-by-prettify"><br></spa=
n><span style=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail=
-m_-3526040043261261328styled-by-prettify">}</span><span style=3D"color:rgb=
(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-=
by-prettify"><br></span></div></code></div><br><br>After:<br><br><div style=
=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-=
style:solid;border-width:1px" class=3D"m_-4965140692953911880gmail-m_-35260=
40043261261328prettyprint"><code class=3D"m_-4965140692953911880gmail-m_-35=
26040043261261328prettyprint"><div class=3D"m_-4965140692953911880gmail-m_-=
3526040043261261328subprettyprint"><span style=3D"color:rgb(0,0,136)" class=
=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify">a=
uto</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880g=
mail-m_-3526040043261261328styled-by-prettify"> </span><span style=3D"color=
:rgb(0,0,136)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328s=
tyled-by-prettify">constexpr</span><span style=3D"color:rgb(0,0,0)" class=
=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify"> =
f</span><span style=3D"color:rgb(102,102,0)" class=3D"m_-496514069295391188=
0gmail-m_-3526040043261261328styled-by-prettify">()</span><span style=3D"co=
lor:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328=
styled-by-prettify"> </span><span style=3D"color:rgb(102,102,0)" class=3D"m=
_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify">{</spa=
n><span style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-=
3526040043261261328styled-by-prettify"> </span><span style=3D"color:rgb(0,0=
,136)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by=
-prettify">return</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-496514=
0692953911880gmail-m_-3526040043261261328styled-by-prettify"> </span><span =
style=3D"color:rgb(0,102,102)" class=3D"m_-4965140692953911880gmail-m_-3526=
040043261261328styled-by-prettify">5</span><span style=3D"color:rgb(102,102=
,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-p=
rettify">;</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953=
911880gmail-m_-3526040043261261328styled-by-prettify"> </span><span style=
=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-352604004=
3261261328styled-by-prettify">}</span><span style=3D"color:rgb(0,0,0)" clas=
s=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify">=
<br></span><span style=3D"color:rgb(0,0,136)" class=3D"m_-49651406929539118=
80gmail-m_-3526040043261261328styled-by-prettify">auto</span><span style=3D=
"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261=
328styled-by-prettify"> g</span><span style=3D"color:rgb(102,102,0)" class=
=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify">(=
)</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gma=
il-m_-3526040043261261328styled-by-prettify"> </span><span style=3D"color:r=
gb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328s=
tyled-by-prettify">{</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-496=
5140692953911880gmail-m_-3526040043261261328styled-by-prettify"> </span><sp=
an style=3D"color:rgb(0,0,136)" class=3D"m_-4965140692953911880gmail-m_-352=
6040043261261328styled-by-prettify">return</span><span style=3D"color:rgb(0=
,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by=
-prettify"> </span><span style=3D"color:rgb(0,102,102)" class=3D"m_-4965140=
692953911880gmail-m_-3526040043261261328styled-by-prettify">6</span><span s=
tyle=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-35260=
40043261261328styled-by-prettify">;</span><span style=3D"color:rgb(0,0,0)" =
class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-pretti=
fy"> </span><span style=3D"color:rgb(102,102,0)" class=3D"m_-49651406929539=
11880gmail-m_-3526040043261261328styled-by-prettify">}</span><span style=3D=
"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261=
328styled-by-prettify"><br></span><span style=3D"color:rgb(0,0,136)" class=
=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify">a=
uto</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880g=
mail-m_-3526040043261261328styled-by-prettify"> h</span><span style=3D"colo=
r:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-35260400432612613=
28styled-by-prettify">()</span><span style=3D"color:rgb(0,0,0)" class=3D"m_=
-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify"><br></s=
pan><span style=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gma=
il-m_-3526040043261261328styled-by-prettify">{</span><span style=3D"color:r=
gb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328style=
d-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color:rgb(0,0,136)" =
class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-pretti=
fy">auto</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-496514069295391=
1880gmail-m_-3526040043261261328styled-by-prettify"> v </span><span style=
=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-352604004=
3261261328styled-by-prettify">=3D</span><span style=3D"color:rgb(0,0,0)" cl=
ass=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify=
"> vector</span><span style=3D"color:rgb(0,136,0)" class=3D"m_-496514069295=
3911880gmail-m_-3526040043261261328styled-by-prettify"><int></span><s=
pan style=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-=
3526040043261261328styled-by-prettify">();</span><span style=3D"color:rgb(0=
,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by=
-prettify"><br>=C2=A0 =C2=A0 a</span><span style=3D"color:rgb(102,102,0)" c=
lass=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettif=
y">.</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880=
gmail-m_-3526040043261261328styled-by-prettify">push_back</span><span style=
=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-352604004=
3261261328styled-by-prettify">(</span><span style=3D"color:rgb(0,102,102)" =
class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-pretti=
fy">7</span><span style=3D"color:rgb(102,102,0)" class=3D"m_-49651406929539=
11880gmail-m_-3526040043261261328styled-by-prettify">);</span><span style=
=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261=
261328styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color:rgb=
(0,0,136)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328style=
d-by-prettify">return</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-49=
65140692953911880gmail-m_-3526040043261261328styled-by-prettify"> a</span><=
span style=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_=
-3526040043261261328styled-by-prettify">[</span><span style=3D"color:rgb(0,=
102,102)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled=
-by-prettify">0</span><span style=3D"color:rgb(102,102,0)" class=3D"m_-4965=
140692953911880gmail-m_-3526040043261261328styled-by-prettify">];</span><sp=
an style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-35260=
40043261261328styled-by-prettify"><br></span><span style=3D"color:rgb(102,1=
02,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by=
-prettify">}</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-49651406929=
53911880gmail-m_-3526040043261261328styled-by-prettify"><br><br></span><spa=
n style=3D"color:rgb(0,0,136)" class=3D"m_-4965140692953911880gmail-m_-3526=
040043261261328styled-by-prettify">template</span><span style=3D"color:rgb(=
0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-b=
y-prettify"> </span><span style=3D"color:rgb(102,102,0)" class=3D"m_-496514=
0692953911880gmail-m_-3526040043261261328styled-by-prettify"><</span><sp=
an style=3D"color:rgb(0,0,136)" class=3D"m_-4965140692953911880gmail-m_-352=
6040043261261328styled-by-prettify">int</span><span style=3D"color:rgb(0,0,=
0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-pr=
ettify"> X</span><span style=3D"color:rgb(102,102,0)" class=3D"m_-496514069=
2953911880gmail-m_-3526040043261261328styled-by-prettify">></span><span =
style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-35260400=
43261261328styled-by-prettify"><br></span><span style=3D"color:rgb(0,0,136)=
" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-pret=
tify">class</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-496514069295=
3911880gmail-m_-3526040043261261328styled-by-prettify"> C </span><span styl=
e=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-35260400=
43261261328styled-by-prettify">{};</span><span style=3D"color:rgb(0,0,0)" c=
lass=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettif=
y"><br><br></span><span style=3D"color:rgb(0,0,136)" class=3D"m_-4965140692=
953911880gmail-m_-3526040043261261328styled-by-prettify">int</span><span st=
yle=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043=
261261328styled-by-prettify"> main</span><span style=3D"color:rgb(102,102,0=
)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-pre=
ttify">()</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-49651406929539=
11880gmail-m_-3526040043261261328styled-by-prettify"><br></span><span style=
=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-352604004=
3261261328styled-by-prettify">{</span><span style=3D"color:rgb(0,0,0)" clas=
s=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify">=
<br>=C2=A0 =C2=A0 </span><span style=3D"color:rgb(0,0,136)" class=3D"m_-496=
5140692953911880gmail-m_-3526040043261261328styled-by-prettify">auto</span>=
<span style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-35=
26040043261261328styled-by-prettify"> x </span><span style=3D"color:rgb(102=
,102,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-=
by-prettify">=3D</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-4965140=
692953911880gmail-m_-3526040043261261328styled-by-prettify"> C</span><span =
style=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-3526=
040043261261328styled-by-prettify"><</span><span style=3D"color:rgb(0,0,=
0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-pr=
ettify">f</span><span style=3D"color:rgb(102,102,0)" class=3D"m_-4965140692=
953911880gmail-m_-3526040043261261328styled-by-prettify">()>();</span><s=
pan style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526=
040043261261328styled-by-prettify"> </span><span style=3D"color:rgb(136,0,0=
)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-pre=
ttify">// OK</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-49651406929=
53911880gmail-m_-3526040043261261328styled-by-prettify"><br>=C2=A0 =C2=A0 <=
/span><span style=3D"color:rgb(0,0,136)" class=3D"m_-4965140692953911880gma=
il-m_-3526040043261261328styled-by-prettify">auto</span><span style=3D"colo=
r:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328st=
yled-by-prettify"> y </span><span style=3D"color:rgb(102,102,0)" class=3D"m=
_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify">=3D</s=
pan><span style=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m=
_-3526040043261261328styled-by-prettify"> C</span><span style=3D"color:rgb(=
102,102,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styl=
ed-by-prettify"><</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-496=
5140692953911880gmail-m_-3526040043261261328styled-by-prettify">g</span><sp=
an style=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-3=
526040043261261328styled-by-prettify">()>();</span><span style=3D"color:=
rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styl=
ed-by-prettify"> </span><span style=3D"color:rgb(136,0,0)" class=3D"m_-4965=
140692953911880gmail-m_-3526040043261261328styled-by-prettify">// OK, g is =
implicitly constexpr</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-496=
5140692953911880gmail-m_-3526040043261261328styled-by-prettify"><br>=C2=A0 =
=C2=A0 </span><span style=3D"color:rgb(0,0,136)" class=3D"m_-49651406929539=
11880gmail-m_-3526040043261261328styled-by-prettify">auto</span><span style=
=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261=
261328styled-by-prettify"> z </span><span style=3D"color:rgb(102,102,0)" cl=
ass=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify=
">=3D</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-496514069295391188=
0gmail-m_-3526040043261261328styled-by-prettify"> C</span><span style=3D"co=
lor:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_-352604004326126=
1328styled-by-prettify"><</span><span style=3D"color:rgb(0,0,0)" class=
=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify">h=
</span><span style=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880=
gmail-m_-3526040043261261328styled-by-prettify">()>();</span><span style=
=3D"color:rgb(0,0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261=
261328styled-by-prettify"> </span><span style=3D"color:rgb(136,0,0)" class=
=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-prettify">/=
/ compilation error</span><span style=3D"color:rgb(0,0,0)" class=3D"m_-4965=
140692953911880gmail-m_-3526040043261261328styled-by-prettify"><br></span><=
span style=3D"color:rgb(102,102,0)" class=3D"m_-4965140692953911880gmail-m_=
-3526040043261261328styled-by-prettify">}</span><span style=3D"color:rgb(0,=
0,0)" class=3D"m_-4965140692953911880gmail-m_-3526040043261261328styled-by-=
prettify"><br></span></div></code></div><br><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" target=3D"_=
blank" rel=3D"noreferrer">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank" rel=3D"noreferrer">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/8de3edfa-f177-4dce-8127-45e928ae3f5d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank" =
rel=3D"noreferrer">https://groups.google.com/a/isocpp.org/d/msgid/std-propo=
sals/8de3edfa-f177-4dce-8127-45e928ae3f5d%40isocpp.org</a>.<br>
</blockquote></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" target=3D"_=
blank" rel=3D"noreferrer">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank" rel=3D"noreferrer">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/CALvx3hZLnda%2BN_RhLw2qDHFbeuGyu8tnXC=
8-W6VruW8XxZxfNA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r" target=3D"_blank" rel=3D"noreferrer">https://groups.google.com/a/isocpp.=
org/d/msgid/std-proposals/CALvx3hZLnda%2BN_RhLw2qDHFbeuGyu8tnXC8-W6VruW8XxZ=
xfNA%40mail.gmail.com</a>.<br>
</blockquote></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/CAMDbWJHVh9XoDqwzAAsHjP%3DO%3DGs7%3Dw=
9u6n2tZOXnOMy7Hp%2BNrw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoo=
ter">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAMDbWJHV=
h9XoDqwzAAsHjP%3DO%3DGs7%3Dw9u6n2tZOXnOMy7Hp%2BNrw%40mail.gmail.com</a>.<br=
/>
--000000000000dce1e40573f1c740--
.
Author: David Brown <david@westcontrol.com>
Date: Tue, 21 Aug 2018 15:20:00 +0200
Raw View
On 21/08/18 15:12, Phil Miller wrote:
> This potentially creates problems for API stability. A published
> function marked as constexpr would have to stay constexpr. One that the
> compiler infers as constexpr and gets used as such could be broken in a
> later version, causing calling code to fail to compile or to silently
> degrade in performance.
So you mark functions in an API that are intended to be usable as
constants with "constexpr", exactly as you do now. People using an
"implicit constexpr" function in the context of a constant expression
are taking a risk - just as they are with any other undocumented
assumptions about an API.
The proposal here gives a convenient short-cut for people writing their
own code.
>
> On Tue, Aug 21, 2018, 8:07 AM Richard Hodges <hodges.r@gmail.com
> <mailto:hodges.r@gmail.com>> wrote:
>
>
>
> On Tue, 21 Aug 2018 at 13:12, Dimitrij Mijoski <dim.mj.p@gmail.com
> <mailto:dim.mj.p@gmail.com>> wrote:
>
> Compilers can do compile time evaluation of functions since
> ages, even before constexpr existed, mostly for optimization.
> There should be no trouble implementing this feature. Right now
> there are formal rules if a function can be constexpr. If it
> meets all of them, it should be one.
>
>
> Difficult to argue against this IMHO, since lambdas are constexpr by
> default as of c++17.
>
> #include <vector>
>
> auto constexpr f() { return 5; }
> auto g = []() { return 6; };
> auto h = []()
> {
> auto v = std::vector<int>();
> v.push_back(7);
> return v[0];
> };
>
> template <int X>
> class C {};
>
> int main()
> {
> auto x = C<f()>(); // OK
> auto y = C<g()>(); // OK
> // auto z = C<h()>(); // compilation error
> }
>
>
>
>
> Before:
>
> |
> autoconstexprf(){return5;}
> autog(){return6;}
> autoh()
> {
> autov =vector<int>();
> a.push_back(7);
> returna[0];
> }
>
> template<intX>
> classC {};
>
> intmain()
> {
> autox =C<f()>();// OK
> autoy =C<g()>();// compilation error
> autoz =C<h()>();// compilation error
> }
> |
>
>
> After:
>
> |
> autoconstexprf(){return5;}
> autog(){return6;}
> autoh()
> {
> autov =vector<int>();
> a.push_back(7);
> returna[0];
> }
>
> template<intX>
> classC {};
>
> intmain()
> {
> autox =C<f()>();// OK
> autoy =C<g()>();// OK, g is implicitly constexpr
> autoz =C<h()>();// compilation error
> }
> |
>
--
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/plh3dt%24aqj%241%40blaine.gmane.org.
.
Author: "Tam S. B." <cpplearner@outlook.com>
Date: Tue, 21 Aug 2018 13:21:16 +0000
Raw View
You need to convince people that this does not slow down compilation or bre=
ak existing code (AFAIK it can change the semantics of valid program when S=
FINAE is involved.) Probably the best way is to create a prototype implemen=
tation and test it against some code bases.
--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/DM5PR22MB16895FF76E380DFAD5473A41E5310%40DM5PR22=
MB1689.namprd22.prod.outlook.com.
.
Author: Jake Arkinstall <jake.arkinstall@gmail.com>
Date: Tue, 21 Aug 2018 14:56:54 +0100
Raw View
--000000000000afd3c90573f266eb
Content-Type: text/plain; charset="UTF-8"
Usually one forces the definition to obey rules set out by the declaration.
This is the opposite of that, inferring properties from the definition. Im
generally for it*, and I also think the same should apply to some other
properties, e.g. const. Essentially all methods are assumed to be const,
constexpr, noexcept, etc unless they demonstrate otherwise - I don't think
it's reasonable for a compiler to re-evaluate a function in a constexpr
setting upon a call from a constexpr context.
It won't be usable when you separate declaration and definition, so people
who supply libraries which aren't header-only won't be able to benefit from
this. It almost seems to me that we should assume const, noexcept,
constexpr unless a user negates it with a keyword, not assume non-const,
throws, and non-constexpr unless a user specifies it. For me it seems like
we're doing things backwards.
* - however, I don't think we should or could do this any time soon. I
think it should be a long term goal.
On Tue, 21 Aug 2018, 14:21 Tam S. B., <cpplearner@outlook.com> wrote:
> You need to convince people that this does not slow down compilation or
> break existing code (AFAIK it can change the semantics of valid program
> when SFINAE is involved.) Probably the best way is to create a prototype
> implementation and test it against some code bases.
>
> --
> 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/DM5PR22MB16895FF76E380DFAD5473A41E5310%40DM5PR22MB1689.namprd22.prod.outlook.com
> .
>
--
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/CAC%2B0CCNvFhx7x%3D8OdDNboCU64495LuUL1CMEfNN5dqEuBn2P7Q%40mail.gmail.com.
--000000000000afd3c90573f266eb
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"auto">Usually one forces the definition to obey rules set out b=
y the declaration. This is the opposite of that, inferring properties from =
the definition. Im generally for it*, and I also think the same should appl=
y to some other properties, e.g. const. Essentially all methods are assumed=
to be const, constexpr, noexcept, etc unless they demonstrate otherwise - =
I don't think it's reasonable for a compiler to re-evaluate a funct=
ion in a constexpr setting upon a call from a constexpr context.<div dir=3D=
"auto"><br></div><div dir=3D"auto">It won't be usable when you separate=
declaration and definition, so people who supply libraries which aren'=
t header-only won't be able to benefit from this. It almost seems to me=
that we should assume const, noexcept, constexpr unless a user negates it =
with a keyword, not assume non-const, throws, and non-constexpr unless a us=
er specifies it. For me it seems like we're doing things backwards.</di=
v><div dir=3D"auto"><br></div><div dir=3D"auto">* - however, I don't th=
ink we should or could do this any time soon. I think it should be a long t=
erm goal.</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Tue=
, 21 Aug 2018, 14:21 Tam S. B., <<a href=3D"mailto:cpplearner@outlook.co=
m">cpplearner@outlook.com</a>> wrote:<br></div><blockquote class=3D"gmai=
l_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left=
:1ex">You need to convince people that this does not slow down compilation =
or break existing code (AFAIK it can change the semantics of valid program =
when SFINAE is involved.) Probably the best way is to create a prototype im=
plementation and test it against some code bases.<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 <a href=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org" target=3D=
"_blank" rel=3D"noreferrer">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank" rel=3D"noreferrer">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/DM5PR22MB16895FF76E380DFAD5473A41E531=
0%40DM5PR22MB1689.namprd22.prod.outlook.com" rel=3D"noreferrer noreferrer" =
target=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/std-propos=
als/DM5PR22MB16895FF76E380DFAD5473A41E5310%40DM5PR22MB1689.namprd22.prod.ou=
tlook.com</a>.<br>
</blockquote></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/CAC%2B0CCNvFhx7x%3D8OdDNboCU64495LuUL=
1CMEfNN5dqEuBn2P7Q%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCNvFh=
x7x%3D8OdDNboCU64495LuUL1CMEfNN5dqEuBn2P7Q%40mail.gmail.com</a>.<br />
--000000000000afd3c90573f266eb--
.
Author: Barry Revzin <barry.revzin@gmail.com>
Date: Tue, 21 Aug 2018 08:48:35 -0700 (PDT)
Raw View
------=_Part_2039_95323087.1534866516044
Content-Type: multipart/alternative;
boundary="----=_Part_2040_1696336372.1534866516045"
------=_Part_2040_1696336372.1534866516045
Content-Type: text/plain; charset="UTF-8"
On Tuesday, August 21, 2018 at 8:12:43 AM UTC-5, Phil Miller wrote:
>
> This potentially creates problems for API stability. A published function
> marked as constexpr would have to stay constexpr. One that the compiler
> infers as constexpr and gets used as such could be broken in a later
> version, causing calling code to fail to compile or to silently degrade in
> performance.
>
This ^^ is the most compelling argument against implicit constexpr to me.
Hyrum's Law: once you make a function, that may not be intended to be used
as a constexpr function that happens to be usable as such, somebody,
somewhere, will depend on it being usable as a constant expression. And so
now you change something in the middle of a function, which you wouldn't
consider to be an API change, and suddenly it breaks code anyway.
--
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/8107fca9-7a2b-4513-84c0-4309cd9c5c9e%40isocpp.org.
------=_Part_2040_1696336372.1534866516045
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Tuesday, August 21, 2018 at 8:12:43 AM UTC-5, Phil Mill=
er wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: =
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"auto">Thi=
s potentially creates problems for API stability. A published function mark=
ed as constexpr would have to stay constexpr. One that the compiler infers =
as constexpr and gets used as such could be broken in a later version, caus=
ing calling code to fail to compile or to silently degrade in performance.<=
/div></blockquote><div><br></div><div>This ^^ is the most compelling argume=
nt against implicit constexpr to me. Hyrum's Law: once you make a funct=
ion, that may not be intended to be used as a constexpr function that happe=
ns to be usable as such, somebody, somewhere, will depend on it being usabl=
e as a constant expression. And so now you change something in the middle o=
f a function, which you wouldn't consider to be an API change, and sudd=
enly it breaks code anyway.</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/8107fca9-7a2b-4513-84c0-4309cd9c5c9e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/8107fca9-7a2b-4513-84c0-4309cd9c5c9e=
%40isocpp.org</a>.<br />
------=_Part_2040_1696336372.1534866516045--
------=_Part_2039_95323087.1534866516044--
.
Author: Nicolas Lesser <blitzrakete@gmail.com>
Date: Tue, 21 Aug 2018 19:14:31 +0200
Raw View
--000000000000d8944b0573f529eb
Content-Type: text/plain; charset="UTF-8"
On Tue, Aug 21, 2018 at 5:48 PM Barry Revzin <barry.revzin@gmail.com> wrote:
> On Tuesday, August 21, 2018 at 8:12:43 AM UTC-5, Phil Miller wrote:
>>
>> This potentially creates problems for API stability. A published function
>> marked as constexpr would have to stay constexpr. One that the compiler
>> infers as constexpr and gets used as such could be broken in a later
>> version, causing calling code to fail to compile or to silently degrade in
>> performance.
>>
>
> This ^^ is the most compelling argument against implicit constexpr to me.
> Hyrum's Law: once you make a function, that may not be intended to be used
> as a constexpr function that happens to be usable as such, somebody,
> somewhere, will depend on it being usable as a constant expression. And so
> now you change something in the middle of a function, which you wouldn't
> consider to be an API change, and suddenly it breaks code anyway.
>
And more importantly, this is *exactly* the reason for the existence of
[constexpr.functions] <http://eel.is/c++draft/constexpr.functions>:
> *An implementation shall not declare any standard library function
signature as constexpr except for those where it is explicitly required. *
With implicit constexpr, implementations would have to no choice but to
break that rule in some cases, so you must have a very strong motivation to
do so.
>
--
> 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/8107fca9-7a2b-4513-84c0-4309cd9c5c9e%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/8107fca9-7a2b-4513-84c0-4309cd9c5c9e%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
--
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/CALmDwq0KmOuu2km61OuUzkCZNqbQ1yKO3QrN5NeyZg1X%2BWZfXg%40mail.gmail.com.
--000000000000d8944b0573f529eb
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr">On Tue, Aug 21=
, 2018 at 5:48 PM Barry Revzin <<a href=3D"mailto:barry.revzin@gmail.com=
">barry.revzin@gmail.com</a>> wrote:<br></div><blockquote class=3D"gmail=
_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204=
,204);padding-left:1ex"><div dir=3D"ltr">On Tuesday, August 21, 2018 at 8:1=
2:43 AM UTC-5, Phil Miller wrote:<blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex"><div dir=3D"auto">This potentially creates problems for API stabili=
ty. A published function marked as constexpr would have to stay constexpr. =
One that the compiler infers as constexpr and gets used as such could be br=
oken in a later version, causing calling code to fail to compile or to sile=
ntly degrade in performance.</div></blockquote><div><br></div><div>This ^^ =
is the most compelling argument against implicit constexpr to me. Hyrum'=
;s Law: once you make a function, that may not be intended to be used as a =
constexpr function that happens to be usable as such, somebody, somewhere, =
will depend on it being usable as a constant expression. And so now you cha=
nge something in the middle of a function, which you wouldn't consider =
to be an API change, and suddenly it breaks code anyway.</div></div></block=
quote><div><br></div><div>And more importantly, this is <i>exactly</i>=C2=
=A0the reason for the existence of=C2=A0<a href=3D"http://eel.is/c++draft/c=
onstexpr.functions">[constexpr.functions]</a>:</div><div><b><br></b></div><=
div>=C2=A0>=C2=A0=C2=A0<b>An implementation shall not declare any standa=
rd library function signature as <i>constexpr</i> except for those where it=
is explicitly required.=C2=A0</b></div><div>=C2=A0</div><div>With implicit=
constexpr, implementations would have to no choice but to break that rule =
in some cases, so you must have a very strong motivation to do so.</div><bl=
ockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-lef=
t:1px solid rgb(204,204,204);padding-left:1ex">=C2=A0</blockquote><blockquo=
te class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px =
solid rgb(204,204,204);padding-left:1ex">
<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" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">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/8107fca9-7a2b-4513-84c0-4309cd9c5c9e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/8107fca9-7a2b-=
4513-84c0-4309cd9c5c9e%40isocpp.org</a>.<br>
</blockquote></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/CALmDwq0KmOuu2km61OuUzkCZNqbQ1yKO3QrN=
5NeyZg1X%2BWZfXg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq0KmOuu2k=
m61OuUzkCZNqbQ1yKO3QrN5NeyZg1X%2BWZfXg%40mail.gmail.com</a>.<br />
--000000000000d8944b0573f529eb--
.
Author: Jake Arkinstall <jake.arkinstall@gmail.com>
Date: Tue, 21 Aug 2018 19:40:03 +0100
Raw View
--000000000000501b530573f65b7c
Content-Type: text/plain; charset="UTF-8"
On Tue, 21 Aug 2018, 16:48 Barry Revzin, <barry.revzin@gmail.com> wrote:
> On Tuesday, August 21, 2018 at 8:12:43 AM UTC-5, Phil Miller wrote:
>>
>> This potentially creates problems for API stability. A published function
>> marked as constexpr would have to stay constexpr. One that the compiler
>> infers as constexpr and gets used as such could be broken in a later
>> version, causing calling code to fail to compile or to silently degrade in
>> performance.
>>
>
> This ^^ is the most compelling argument against implicit constexpr to me.
> Hyrum's Law: once you make a function, that may not be intended to be used
> as a constexpr function that happens to be usable as such, somebody,
> somewhere, will depend on it being usable as a constant expression. And so
> now you change something in the middle of a function, which you wouldn't
> consider to be an API change, and suddenly it breaks code anyway.
>
That's why I'd prefer (in a long time) explicit non-constexpr rather than
explicit constexpr. As time goes on, more and more constexpr functionality
is available, and I do think there will be a time when we decide to stop
explicitly telling the compiler that we are allowed to X, and to start only
telling the compiler when we can't X - which will be limited to places
where state is determined through an interface with the system.
After all, we do choose constexpr by exclusion. Constexpr all the things?
Non-constexpr a few of the things. A blacklist approach would be more
descriptive than a whitelist, and the way the standard library is going at
the moment I think it would be cleaner too.
That's what I'd like to see happen by C++32 anyway. Same goes for const.
--
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/CAC%2B0CCN7-oqUn11%2BtqjLm6sZu6UCvVnnqqZnkfwY7ay4O7kweg%40mail.gmail.com.
--000000000000501b530573f65b7c
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"auto"><div><div class=3D"gmail_quote"><div dir=3D"ltr">On Tue, =
21 Aug 2018, 16:48 Barry Revzin, <<a href=3D"mailto:barry.revzin@gmail.c=
om" target=3D"_blank" rel=3D"noreferrer">barry.revzin@gmail.com</a>> wro=
te:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">On Tuesday, Au=
gust 21, 2018 at 8:12:43 AM UTC-5, Phil Miller wrote:<blockquote class=3D"g=
mail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;=
padding-left:1ex"><div dir=3D"auto">This potentially creates problems for A=
PI stability. A published function marked as constexpr would have to stay c=
onstexpr. One that the compiler infers as constexpr and gets used as such c=
ould be broken in a later version, causing calling code to fail to compile =
or to silently degrade in performance.</div></blockquote><div><br></div><di=
v>This ^^ is the most compelling argument against implicit constexpr to me.=
Hyrum's Law: once you make a function, that may not be intended to be =
used as a constexpr function that happens to be usable as such, somebody, s=
omewhere, will depend on it being usable as a constant expression. And so n=
ow you change something in the middle of a function, which you wouldn't=
consider to be an API change, and suddenly it breaks code anyway.</div></d=
iv></blockquote></div></div><div dir=3D"auto"><br></div><div dir=3D"auto">T=
hat's why I'd prefer (in a long time) explicit non-constexpr rather=
than explicit constexpr. As time goes on, more and more constexpr function=
ality is available, and I do think there will be a time when we decide to s=
top explicitly telling the compiler that we are allowed to X, and to start =
only telling the compiler when we can't X - which will be limited to pl=
aces where state is determined through an interface with the system.<br></d=
iv><div dir=3D"auto"><br></div><div dir=3D"auto">After all, we do choose co=
nstexpr by exclusion. Constexpr all the things? Non-constexpr a few of the =
things. A blacklist approach would be more descriptive than a whitelist, an=
d the way the standard library is going at the moment I think it would be c=
leaner too.</div><div dir=3D"auto"><br></div><div dir=3D"auto">That's w=
hat I'd like to see happen by C++32 anyway. Same goes for const.</div><=
div dir=3D"auto"></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/CAC%2B0CCN7-oqUn11%2BtqjLm6sZu6UCvVnn=
qqZnkfwY7ay4O7kweg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCN7-o=
qUn11%2BtqjLm6sZu6UCvVnnqqZnkfwY7ay4O7kweg%40mail.gmail.com</a>.<br />
--000000000000501b530573f65b7c--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Tue, 21 Aug 2018 15:21:43 -0700 (PDT)
Raw View
------=_Part_1627_1459529577.1534890103358
Content-Type: multipart/alternative;
boundary="----=_Part_1628_379003843.1534890103358"
------=_Part_1628_379003843.1534890103358
Content-Type: text/plain; charset="UTF-8"
On Tuesday, August 21, 2018 at 9:20:15 AM UTC-4, David Brown wrote:
>
> On 21/08/18 15:12, Phil Miller wrote:
> > This potentially creates problems for API stability. A published
> > function marked as constexpr would have to stay constexpr. One that the
> > compiler infers as constexpr and gets used as such could be broken in a
> > later version, causing calling code to fail to compile or to silently
> > degrade in performance.
>
> So you mark functions in an API that are intended to be usable as
> constants with "constexpr", exactly as you do now. People using an
> "implicit constexpr" function in the context of a constant expression
> are taking a risk - just as they are with any other undocumented
> assumptions about an API.
>
The problem is that there's nothing *telling them* that they're taking that
risk. Most programmers, even C++ programmers, are not that careful. If
their code compiles today, then they fully expect it to compile tomorrow.
Even if you technically didn't promise that it would compile tomorrow when
used in a certain way, if that way compiles today, people will expect it to
compile tomorrow.
If the goal is just to make the language more convenient, then the change
needs to be more targeted than this. Maybe in a post-modules world, we can
have some kind of marker that says "from here on out, all functions that
can be `constexpr` will be `constexpr`", with some way to turn it off
per-function. And something similar for `noexcept`. This would only be able
to work in a module, since they don't leak (the same way that `using
namespace` declarations will become a lot more usable once we know they
can't leak).
--
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/7da88cfa-bb11-40e6-a74e-c28f42ecb08e%40isocpp.org.
------=_Part_1628_379003843.1534890103358
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Tuesday, August 21, 2018 at 9:20:15 AM UTC-4, D=
avid Brown wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 21/08/18 1=
5:12, Phil Miller wrote:
<br>> This potentially creates problems for API stability. A published
<br>> function marked as constexpr would have to stay constexpr. One tha=
t the
<br>> compiler infers as constexpr and gets used as such could be broken=
in a
<br>> later version, causing calling code to fail to compile or to silen=
tly
<br>> degrade in performance.
<br>
<br>So you mark functions in an API that are intended to be usable as
<br>constants with "constexpr", exactly as you do now. =C2=A0Peop=
le using an
<br>"implicit constexpr" function in the context of a constant ex=
pression
<br>are taking a risk - just as they are with any other undocumented
<br>assumptions about an API.<br></blockquote><div><br></div><div>The probl=
em is that there's nothing <i>telling them</i> that they're taking =
that risk. Most programmers, even C++ programmers, are not that careful. If=
their code compiles today, then they fully expect it to compile tomorrow. =
Even if you technically didn't promise that it would compile tomorrow w=
hen used in a certain way, if that way compiles today, people will expect i=
t to compile tomorrow.</div><div><br></div><div>If the goal is just to make=
the language more convenient, then the change needs to be more targeted th=
an this. Maybe in a post-modules world, we can have some kind of marker tha=
t says "from here on out, all functions that can be `constexpr` will b=
e `constexpr`", with some way to turn it off per-function. And somethi=
ng similar for `noexcept`. This would only be able to work in a module, sin=
ce they don't leak (the same way that `using namespace` declarations wi=
ll become a lot more usable once we know they can't leak).</div><br></d=
iv>
<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/7da88cfa-bb11-40e6-a74e-c28f42ecb08e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/7da88cfa-bb11-40e6-a74e-c28f42ecb08e=
%40isocpp.org</a>.<br />
------=_Part_1628_379003843.1534890103358--
------=_Part_1627_1459529577.1534890103358--
.
Author: Richard Hodges <hodges.r@gmail.com>
Date: Wed, 22 Aug 2018 08:21:43 +0100
Raw View
--00000000000046bcf0057400fff8
Content-Type: text/plain; charset="UTF-8"
Reading through the arguments against, some very valid points are made:
* std library functions must not be constexpr unless explicitly marked as
so.
* functions that could potentially be available outside the translation
unit are problematic, as they may be deduced to be constexpr in one TU and
not in others.
* a change in the function's implementation might change the function from
constexpr to non constexpr, causing surprising compilation errors.
It occurs to me that there is one class of function that could be a safe
candidate for automatic promotion to constexpr.
Functions which:
a. are defined in an anonymous namespace, and
b. whose address is never taken within the translation unit
Whether this gives gives us anything more than we have currently, I am
starting to doubt.
On Tue, 21 Aug 2018 at 23:21, Nicol Bolas <jmckesson@gmail.com> wrote:
>
>
> On Tuesday, August 21, 2018 at 9:20:15 AM UTC-4, David Brown wrote:
>>
>> On 21/08/18 15:12, Phil Miller wrote:
>> > This potentially creates problems for API stability. A published
>> > function marked as constexpr would have to stay constexpr. One that the
>> > compiler infers as constexpr and gets used as such could be broken in a
>> > later version, causing calling code to fail to compile or to silently
>> > degrade in performance.
>>
>> So you mark functions in an API that are intended to be usable as
>> constants with "constexpr", exactly as you do now. People using an
>> "implicit constexpr" function in the context of a constant expression
>> are taking a risk - just as they are with any other undocumented
>> assumptions about an API.
>>
>
> The problem is that there's nothing *telling them* that they're taking
> that risk. Most programmers, even C++ programmers, are not that careful. If
> their code compiles today, then they fully expect it to compile tomorrow.
> Even if you technically didn't promise that it would compile tomorrow when
> used in a certain way, if that way compiles today, people will expect it to
> compile tomorrow.
>
> If the goal is just to make the language more convenient, then the change
> needs to be more targeted than this. Maybe in a post-modules world, we can
> have some kind of marker that says "from here on out, all functions that
> can be `constexpr` will be `constexpr`", with some way to turn it off
> per-function. And something similar for `noexcept`. This would only be able
> to work in a module, since they don't leak (the same way that `using
> namespace` declarations will become a lot more usable once we know they
> can't leak).
>
> --
> 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/7da88cfa-bb11-40e6-a74e-c28f42ecb08e%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/7da88cfa-bb11-40e6-a74e-c28f42ecb08e%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
--
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/CALvx3hY4fcyi5EewDLgM2YGLJGFfE9tB7Az0vDs6zcXKHLDvdw%40mail.gmail.com.
--00000000000046bcf0057400fff8
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Reading through the arguments against, some very valid poi=
nts are made:<div><br></div><div>* std library functions must not be conste=
xpr unless explicitly marked as so.</div><div>* functions that could potent=
ially be available outside the translation unit are problematic, as they ma=
y be deduced to be constexpr in one TU and not in others.</div><div>* a cha=
nge in the function's implementation might change the function from con=
stexpr to non constexpr, causing surprising compilation errors.</div><div><=
br></div><div>It occurs to me that there is one class of function that coul=
d be a safe candidate for automatic promotion to constexpr.</div><div>Funct=
ions which:</div><div>=C2=A0 a. are defined in an anonymous namespace, and<=
/div><div>=C2=A0 b. whose address is never taken within the translation uni=
t</div><div><br></div><div>Whether this gives gives us anything more than w=
e have currently, I am starting to doubt.</div><div><br></div></div><br><di=
v class=3D"gmail_quote"><div dir=3D"ltr">On Tue, 21 Aug 2018 at 23:21, Nico=
l Bolas <<a href=3D"mailto:jmckesson@gmail.com">jmckesson@gmail.com</a>&=
gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><br=
>On Tuesday, August 21, 2018 at 9:20:15 AM UTC-4, David Brown wrote:<blockq=
uote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:=
1px #ccc solid;padding-left:1ex">On 21/08/18 15:12, Phil Miller wrote:
<br>> This potentially creates problems for API stability. A published
<br>> function marked as constexpr would have to stay constexpr. One tha=
t the
<br>> compiler infers as constexpr and gets used as such could be broken=
in a
<br>> later version, causing calling code to fail to compile or to silen=
tly
<br>> degrade in performance.
<br>
<br>So you mark functions in an API that are intended to be usable as
<br>constants with "constexpr", exactly as you do now.=C2=A0 Peop=
le using an
<br>"implicit constexpr" function in the context of a constant ex=
pression
<br>are taking a risk - just as they are with any other undocumented
<br>assumptions about an API.<br></blockquote><div><br></div><div>The probl=
em is that there's nothing <i>telling them</i> that they're taking =
that risk. Most programmers, even C++ programmers, are not that careful. If=
their code compiles today, then they fully expect it to compile tomorrow. =
Even if you technically didn't promise that it would compile tomorrow w=
hen used in a certain way, if that way compiles today, people will expect i=
t to compile tomorrow.</div><div><br></div><div>If the goal is just to make=
the language more convenient, then the change needs to be more targeted th=
an this. Maybe in a post-modules world, we can have some kind of marker tha=
t says "from here on out, all functions that can be `constexpr` will b=
e `constexpr`", with some way to turn it off per-function. And somethi=
ng similar for `noexcept`. This would only be able to work in a module, sin=
ce they don't leak (the same way that `using namespace` declarations wi=
ll become a lot more usable once we know they can't leak).</div><br></d=
iv>
<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" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">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/7da88cfa-bb11-40e6-a74e-c28f42ecb08e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/7da88cfa-bb11-=
40e6-a74e-c28f42ecb08e%40isocpp.org</a>.<br>
</blockquote></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/CALvx3hY4fcyi5EewDLgM2YGLJGFfE9tB7Az0=
vDs6zcXKHLDvdw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALvx3hY4fcyi5Eew=
DLgM2YGLJGFfE9tB7Az0vDs6zcXKHLDvdw%40mail.gmail.com</a>.<br />
--00000000000046bcf0057400fff8--
.
Author: David Brown <david@westcontrol.com>
Date: Wed, 22 Aug 2018 10:27:15 +0200
Raw View
On 22/08/18 00:21, Nicol Bolas wrote:
>
>
> On Tuesday, August 21, 2018 at 9:20:15 AM UTC-4, David Brown wrote:
>
> On 21/08/18 15:12, Phil Miller wrote:
> > This potentially creates problems for API stability. A published
> > function marked as constexpr would have to stay constexpr. One
> that the
> > compiler infers as constexpr and gets used as such could be broken
> in a
> > later version, causing calling code to fail to compile or to silently
> > degrade in performance.
>
> So you mark functions in an API that are intended to be usable as
> constants with "constexpr", exactly as you do now. People using an
> "implicit constexpr" function in the context of a constant expression
> are taking a risk - just as they are with any other undocumented
> assumptions about an API.
>
>
> The problem is that there's nothing /telling them/ that they're taking
> that risk. Most programmers, even C++ programmers, are not that careful.
> If their code compiles today, then they fully expect it to compile
> tomorrow. Even if you technically didn't promise that it would compile
> tomorrow when used in a certain way, if that way compiles today, people
> will expect it to compile tomorrow.
>
Fair enough. I expect that most of these users would not be using the
functions in a context that required a constexpr function, so the number
of "casualties" would be small - but I appreciate your point.
> If the goal is just to make the language more convenient, then the
> change needs to be more targeted than this. Maybe in a post-modules
> world, we can have some kind of marker that says "from here on out, all
> functions that can be `constexpr` will be `constexpr`", with some way to
> turn it off per-function. And something similar for `noexcept`. This
> would only be able to work in a module, since they don't leak (the same
> way that `using namespace` declarations will become a lot more usable
> once we know they can't leak).
>
That seems reasonable to me. I'd like a way to say "all my functions
are noexcept unless explicitly stated otherwise" - not just in module
code. Perhaps such things could be tied to namespaces, as an
alternative to a non-scoped "from here on out" feature. So you would have:
namespace constexpr noexcept MyLibrary { ... }
or something like that.
I'd like something like that for "const" too - everything (functions,
variables, locals, methods) would be "const" by default, like it is in
some more modern languages. But that would need a new keyword for
"unconst" - "variable" or "var", perhaps.
--
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/plj6l0%24bso%241%40blaine.gmane.org.
.