Topic: replace constexpr on functions with pure to
Author: Justin Bassett <jbassett271@gmail.com>
Date: Tue, 26 Jun 2018 23:05:38 -0700
Raw View
--0000000000005e5c6b056f996735
Content-Type: text/plain; charset="UTF-8"
So effectively, you want to standardize GCC's [[gnu::pure]] or
[[gnu::const]] (docs
<https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes>).
Or are you looking for something different?
On Tue, Jun 26, 2018 at 10:42 PM, <ojcraftter@gmail.com> wrote:
>
> int fib(int n) pure
> {
>
> int a{ 0 };
> int b{ 1 };
> while (n-- > 1)
> {
> const int t{ a };
> a = b;
> b += t;
> }
> return b;}
>
>
>
> --
> 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/04c505a2-27ff-47bf-
> 8678-2f4f2906415b%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/04c505a2-27ff-47bf-8678-2f4f2906415b%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/CAPuuy5fPpMgfusOSJT5tDoLbH%3DrmzckOToZhQ0B31KXFL4SJ%2BA%40mail.gmail.com.
--0000000000005e5c6b056f996735
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">So effectively, you want to standardize GCC's [[gnu::p=
ure]] or [[gnu::const]] (<a href=3D"https://gcc.gnu.org/onlinedocs/gcc/Comm=
on-Function-Attributes.html#Common-Function-Attributes">docs</a>). Or are y=
ou looking for something different?</div><div class=3D"gmail_extra"><br><di=
v class=3D"gmail_quote">On Tue, Jun 26, 2018 at 10:42 PM, <span dir=3D"ltr=
"><<a href=3D"mailto:ojcraftter@gmail.com" target=3D"_blank">ojcraftter@=
gmail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"ltr"><div><div class=3D"m_2398207234874134631prettyprint" style=3D"back=
ground-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:so=
lid;border-width:1px;word-wrap:break-word"><code class=3D"m_239820723487413=
4631prettyprint"><div class=3D"m_2398207234874134631subprettyprint"><span s=
tyle=3D"color:#000" class=3D"m_2398207234874134631styled-by-prettify"><br><=
/span><span style=3D"color:#008" class=3D"m_2398207234874134631styled-by-pr=
ettify">int</span><span style=3D"color:#000" class=3D"m_2398207234874134631=
styled-by-prettify"> fib</span><span style=3D"color:#660" class=3D"m_239820=
7234874134631styled-by-prettify">(</span><span style=3D"color:#008" class=
=3D"m_2398207234874134631styled-by-prettify">int</span><span style=3D"color=
:#000" class=3D"m_2398207234874134631styled-by-prettify"> n</span><span sty=
le=3D"color:#660" class=3D"m_2398207234874134631styled-by-prettify">)</span=
><span style=3D"color:#000" class=3D"m_2398207234874134631styled-by-prettif=
y"> pure<br></span><span style=3D"color:#660" class=3D"m_239820723487413463=
1styled-by-prettify">{</span></div></code><pre class=3D"m_23982072348741346=
31lang-c m_2398207234874134631prettyprint m_2398207234874134631prettyprinte=
d" style=3D"margin-bottom:1em;padding:5px;font-variant-numeric:inherit;font=
-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;font-f=
amily:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mon=
o","DejaVu Sans Mono","Bitstream Vera Sans Mono",&=
quot;Courier New",monospace,sans-serif;vertical-align:baseline;box-siz=
ing:inherit;width:auto;max-height:600px;overflow:auto;background-color:rgb(=
239,240,241);color:rgb(57,51,24);word-wrap:normal"><code style=3D"font-styl=
e:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;lin=
e-height:inherit;font-family:Consolas,Menlo,Monaco,"Lucida Console&quo=
t;,"Liberation Mono","DejaVu Sans Mono","Bitstream=
Vera Sans Mono","Courier New",monospace,sans-serif;vertical=
-align:baseline;box-sizing:inherit;white-space:inherit"><span class=3D"m_23=
98207234874134631pln" style=3D"font-style:inherit;font-variant:inherit;font=
-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inheri=
t;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> </spa=
n><span class=3D"m_2398207234874134631typ" style=3D"font-style:inherit;font=
-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inher=
it;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb=
(43,145,175)">int</span><span class=3D"m_2398207234874134631pln" style=3D"f=
ont-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inh=
erit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-si=
zing:inherit;color:rgb(48,51,54)"> a{ </span><span class=3D"m_2398207234874=
134631lit" style=3D"font-style:inherit;font-variant:inherit;font-weight:inh=
erit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-=
align:baseline;box-sizing:inherit;color:rgb(125,39,39)">0 }</span><span cla=
ss=3D"m_2398207234874134631pun" style=3D"font-style:inherit;font-variant:in=
herit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-fam=
ily:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"=
>;</span><span class=3D"m_2398207234874134631pln" style=3D"font-style:inher=
it;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-heigh=
t:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;co=
lor:rgb(48,51,54)">
</span><span class=3D"m_2398207234874134631typ" style=3D"font-style:inh=
erit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-hei=
ght:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;=
color:rgb(43,145,175)">int</span><span class=3D"m_2398207234874134631pln" s=
tyle=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-st=
retch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseli=
ne;box-sizing:inherit;color:rgb(48,51,54)"> b{</span><span class=3D"m_23982=
07234874134631pln" style=3D"font-style:inherit;font-variant:inherit;font-we=
ight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;v=
ertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> </span><spa=
n class=3D"m_2398207234874134631lit" style=3D"font-style:inherit;font-varia=
nt:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;fon=
t-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(125,3=
9,39)">1 }</span><span class=3D"m_2398207234874134631pun" style=3D"font-sty=
le:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;li=
ne-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:in=
herit;color:rgb(48,51,54)">;</span><span class=3D"m_2398207234874134631pln"=
style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-=
stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:base=
line;box-sizing:inherit;color:rgb(48,51,54)">
</span><span class=3D"m_2398207234874134631kwd" style=3D"font-style:inh=
erit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-hei=
ght:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;=
color:rgb(16,16,148)">while</span><span class=3D"m_2398207234874134631pln" =
style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-s=
tretch:inherit;line-height:inherit;font-family:inherit;vertical-align:basel=
ine;box-sizing:inherit;color:rgb(48,51,54)"> </span><span class=3D"m_239820=
7234874134631pun" style=3D"font-style:inherit;font-variant:inherit;font-wei=
ght:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;ve=
rtical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">(</span><span=
class=3D"m_2398207234874134631pln" style=3D"font-style:inherit;font-varian=
t:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font=
-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,=
54)">n</span><span class=3D"m_2398207234874134631pun" style=3D"font-style:i=
nherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-h=
eight:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inheri=
t;color:rgb(48,51,54)">--</span><span class=3D"m_2398207234874134631pln" st=
yle=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-str=
etch:inherit;line-height:inherit;font-family:inherit;vertical-align:baselin=
e;box-sizing:inherit;color:rgb(48,51,54)"> </span><span class=3D"m_23982072=
34874134631pun" style=3D"font-style:inherit;font-variant:inherit;font-weigh=
t:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vert=
ical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">></span><spa=
n class=3D"m_2398207234874134631pln" style=3D"font-style:inherit;font-varia=
nt:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;fon=
t-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51=
,54)"> </span><span class=3D"m_2398207234874134631lit" style=3D"font-style:=
inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-=
height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inher=
it;color:rgb(125,39,39)">1</span><span class=3D"m_2398207234874134631pun" s=
tyle=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-st=
retch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseli=
ne;box-sizing:inherit;color:rgb(48,51,54)">)<br></span><span class=3D"m_239=
8207234874134631pun" style=3D"font-style:inherit;font-variant:inherit;font-=
weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit=
;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)"> {</spa=
n><span class=3D"m_2398207234874134631pln" style=3D"font-style:inherit;font=
-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inher=
it;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb=
(48,51,54)">
const </span><span class=3D"m_2398207234874134631typ" style=3D"font=
-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inheri=
t;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizin=
g:inherit;color:rgb(43,145,175)">int</span><span class=3D"m_239820723487413=
4631pln" style=3D"font-style:inherit;font-variant:inherit;font-weight:inher=
it;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-al=
ign:baseline;box-sizing:inherit;color:rgb(48,51,54)"> t{ </span><span class=
=3D"m_2398207234874134631pln" style=3D"font-style:inherit;font-variant:inhe=
rit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-famil=
y:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">a=
}</span><span class=3D"m_2398207234874134631pun" style=3D"font-style:inher=
it;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-heigh=
t:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;co=
lor:rgb(48,51,54)">;</span><span class=3D"m_2398207234874134631pln" style=
=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretc=
h:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;b=
ox-sizing:inherit;color:rgb(48,51,54)">
a </span><span class=3D"m_2398207234874134631pun" style=3D"font-sty=
le:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;li=
ne-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:in=
herit;color:rgb(48,51,54)">=3D</span><span class=3D"m_2398207234874134631pl=
n" style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;fon=
t-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:ba=
seline;box-sizing:inherit;color:rgb(48,51,54)"> b</span><span class=3D"m_23=
98207234874134631pun" style=3D"font-style:inherit;font-variant:inherit;font=
-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inheri=
t;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">;</span><=
span class=3D"m_2398207234874134631pln" style=3D"font-style:inherit;font-va=
riant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;=
font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48=
,51,54)">
b </span><span class=3D"m_2398207234874134631pun" style=3D"font-sty=
le:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;li=
ne-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:in=
herit;color:rgb(48,51,54)">+=3D</span><span class=3D"m_2398207234874134631p=
ln" style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;fo=
nt-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:b=
aseline;box-sizing:inherit;color:rgb(48,51,54)"> t</span><span class=3D"m_2=
398207234874134631pun" style=3D"font-style:inherit;font-variant:inherit;fon=
t-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inher=
it;vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">;</span>=
<span class=3D"m_2398207234874134631pln" style=3D"font-style:inherit;font-v=
ariant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit=
;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(4=
8,51,54)">
</span><span class=3D"m_2398207234874134631pun" style=3D"font-style:inh=
erit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-hei=
ght:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;=
color:rgb(48,51,54)">}</span><span class=3D"m_2398207234874134631pln" style=
=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretc=
h:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;b=
ox-sizing:inherit;color:rgb(48,51,54)">
</span><span class=3D"m_2398207234874134631kwd" style=3D"font-style:inh=
erit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-hei=
ght:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;=
color:rgb(16,16,148)">return</span><span class=3D"m_2398207234874134631pln"=
style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-=
stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:base=
line;box-sizing:inherit;color:rgb(48,51,54)"> b</span><span class=3D"m_2398=
207234874134631pun" style=3D"font-style:inherit;font-variant:inherit;font-w=
eight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;=
vertical-align:baseline;box-sizing:inherit;color:rgb(48,51,54)">;</span><sp=
an class=3D"m_2398207234874134631pln" style=3D"font-style:inherit;font-vari=
ant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;fo=
nt-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(48,5=
1,54)">
</span><span class=3D"m_2398207234874134631pun" style=3D"font-style:inherit=
;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:=
inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;colo=
r:rgb(48,51,54)">}</span></code></pre></div><span class=3D"HOEnZb"><font co=
lor=3D"#888888"><br><br></font></span></div></div><span class=3D"HOEnZb"><f=
ont color=3D"#888888">
<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@<wbr>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/04c505a2-27ff-47bf-8678-2f4f2906415b%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/04c5=
05a2-27ff-47bf-<wbr>8678-2f4f2906415b%40isocpp.org</a><wbr>.<br>
</font></span></blockquote></div><br></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/CAPuuy5fPpMgfusOSJT5tDoLbH%3DrmzckOTo=
ZhQ0B31KXFL4SJ%2BA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAPuuy5fPpMgf=
usOSJT5tDoLbH%3DrmzckOToZhQ0B31KXFL4SJ%2BA%40mail.gmail.com</a>.<br />
--0000000000005e5c6b056f996735--
.
Author: ojcraftter@gmail.com
Date: Wed, 27 Jun 2018 03:56:02 -0700 (PDT)
Raw View
------=_Part_22756_1034680622.1530096963045
Content-Type: multipart/alternative;
boundary="----=_Part_22757_114631271.1530096963045"
------=_Part_22757_114631271.1530096963045
Content-Type: text/plain; charset="UTF-8"
basically, I want to rename constexpr in function context to pure to
underline the fact that it needs to be a basiclly functional pure function
Am Mittwoch, 27. Juni 2018 08:05:40 UTC+2 schrieb Justin Bassett:
>
> So effectively, you want to standardize GCC's [[gnu::pure]] or
> [[gnu::const]] (docs
> <https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes>).
> Or are you looking for something different?
>
> On Tue, Jun 26, 2018 at 10:42 PM, <ojcra...@gmail.com <javascript:>>
> wrote:
>
>>
>> int fib(int n) pure
>> {
>>
>> int a{ 0 };
>> int b{ 1 };
>> while (n-- > 1)
>> {
>> const int t{ a };
>> a = b;
>> b += t;
>> }
>> return b;}
>>
>>
>>
>> --
>> 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-proposal...@isocpp.org <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/04c505a2-27ff-47bf-8678-2f4f2906415b%40isocpp.org
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/04c505a2-27ff-47bf-8678-2f4f2906415b%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/440630e7-23e5-404c-a59e-fd33f30ee4b7%40isocpp.org.
------=_Part_22757_114631271.1530096963045
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">basically, I want to rename constexpr in function context =
to pure to underline the fact that it needs to be a basiclly functional pur=
e function<br><br>Am Mittwoch, 27. Juni 2018 08:05:40 UTC+2 schrieb Justin =
Bassett:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0=
..8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">So ef=
fectively, you want to standardize GCC's [[gnu::pure]] or [[gnu::const]=
] (<a href=3D"https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes=
..html#Common-Function-Attributes" target=3D"_blank" rel=3D"nofollow" onmous=
edown=3D"this.href=3D'https://www.google.com/url?q\x3dhttps%3A%2F%2Fgcc=
..gnu.org%2Fonlinedocs%2Fgcc%2FCommon-Function-Attributes.html%23Common-Func=
tion-Attributes\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGPLdy0Bgy4kkIUdPYzm=
jPOouVAJw';return true;" onclick=3D"this.href=3D'https://www.google=
..com/url?q\x3dhttps%3A%2F%2Fgcc.gnu.org%2Fonlinedocs%2Fgcc%2FCommon-Functio=
n-Attributes.html%23Common-Function-Attributes\x26sa\x3dD\x26sntz\x3d1\x26u=
sg\x3dAFQjCNGPLdy0Bgy4kkIUdPYzmjPOouVAJw';return true;">docs</a>). Or a=
re you looking for something different?</div><div><br><div class=3D"gmail_q=
uote">On Tue, Jun 26, 2018 at 10:42 PM, <span dir=3D"ltr"><<a href=3D"j=
avascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"YDNpRvrBCAAJ" rel=3D=
"nofollow" onmousedown=3D"this.href=3D'javascript:';return true;" o=
nclick=3D"this.href=3D'javascript:';return true;">ojcra...@gmail.co=
m</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">=
<div><div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,1=
87,187);border-style:solid;border-width:1px;word-wrap:break-word"><code><di=
v><span style=3D"color:#000"><br></span><span style=3D"color:#008">int</spa=
n><span style=3D"color:#000"> fib</span><span style=3D"color:#660">(</span>=
<span style=3D"color:#008">int</span><span style=3D"color:#000"> n</span><s=
pan style=3D"color:#660">)</span><span style=3D"color:#000"> pure<br></span=
><span style=3D"color:#660">{</span></div></code><pre style=3D"margin-botto=
m:1em;padding:5px;font-stretch:inherit;line-height:inherit;font-family:Cons=
olas,Menlo,Monaco,"Lucida Console","Liberation Mono",&q=
uot;DejaVu Sans Mono","Bitstream Vera Sans Mono","Couri=
er New",monospace,sans-serif;vertical-align:baseline;width:auto;max-he=
ight:600px;overflow:auto;background-color:rgb(239,240,241);color:rgb(57,51,=
24);word-wrap:normal"><code style=3D"font-style:inherit;font-variant:inheri=
t;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:=
Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono"=
;,"DejaVu Sans Mono","Bitstream Vera Sans Mono","C=
ourier New",monospace,sans-serif;vertical-align:baseline;white-space:i=
nherit"><span style=3D"font-style:inherit;font-variant:inherit;font-weight:=
inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertic=
al-align:baseline;color:rgb(48,51,54)"> </span><span style=3D"font-style=
:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line=
-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb(43,14=
5,175)">int</span><span style=3D"font-style:inherit;font-variant:inherit;fo=
nt-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inhe=
rit;vertical-align:baseline;color:rgb(48,51,54)"> a{ </span><span style=3D"=
font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:in=
herit;line-height:inherit;font-family:inherit;vertical-align:baseline;color=
:rgb(125,39,39)">0 }</span><span style=3D"font-style:inherit;font-variant:i=
nherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-fa=
mily:inherit;vertical-align:baseline;color:rgb(48,51,54)">;</span><span sty=
le=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stre=
tch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline=
;color:rgb(48,51,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weig=
ht:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;ver=
tical-align:baseline;color:rgb(43,145,175)">int</span><span style=3D"font-s=
tyle:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;=
line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb(4=
8,51,54)"> b{</span><span style=3D"font-style:inherit;font-variant:inherit;=
font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:in=
herit;vertical-align:baseline;color:rgb(48,51,54)"> </span><span style=3D"f=
ont-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inh=
erit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:=
rgb(125,39,39)">1 }</span><span style=3D"font-style:inherit;font-variant:in=
herit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-fam=
ily:inherit;vertical-align:baseline;color:rgb(48,51,54)">;</span><span styl=
e=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stret=
ch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;=
color:rgb(48,51,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weig=
ht:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;ver=
tical-align:baseline;color:rgb(16,16,148)">while</span><span style=3D"font-=
style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit=
;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb(=
48,51,54)"> </span><span style=3D"font-style:inherit;font-variant:inherit;f=
ont-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inh=
erit;vertical-align:baseline;color:rgb(48,51,54)">(</span><span style=3D"fo=
nt-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inhe=
rit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:r=
gb(48,51,54)">n</span><span style=3D"font-style:inherit;font-variant:inheri=
t;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:=
inherit;vertical-align:baseline;color:rgb(48,51,54)">--</span><span style=
=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretc=
h:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;c=
olor:rgb(48,51,54)"> </span><span style=3D"font-style:inherit;font-variant:=
inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-f=
amily:inherit;vertical-align:baseline;color:rgb(48,51,54)">></span><span=
style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-=
stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:base=
line;color:rgb(48,51,54)"> </span><span style=3D"font-style:inherit;font-va=
riant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;=
font-family:inherit;vertical-align:baseline;color:rgb(125,39,39)">1</span><=
span style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;f=
ont-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:=
baseline;color:rgb(48,51,54)">)<br></span><span style=3D"font-style:inherit=
;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:=
inherit;font-family:inherit;vertical-align:baseline;color:rgb(48,51,54)"> =
{</span><span style=3D"font-style:inherit;font-variant:inherit;font-weigh=
t:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vert=
ical-align:baseline;color:rgb(48,51,54)">
const </span><span style=3D"font-style:inherit;font-variant:inherit=
;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:i=
nherit;vertical-align:baseline;color:rgb(43,145,175)">int</span><span style=
=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretc=
h:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;c=
olor:rgb(48,51,54)"> t{ </span><span style=3D"font-style:inherit;font-varia=
nt:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;fon=
t-family:inherit;vertical-align:baseline;color:rgb(48,51,54)">a }</span><sp=
an style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;fon=
t-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:ba=
seline;color:rgb(48,51,54)">;</span><span style=3D"font-style:inherit;font-=
variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inheri=
t;font-family:inherit;vertical-align:baseline;color:rgb(48,51,54)">
a </span><span style=3D"font-style:inherit;font-variant:inherit;fon=
t-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inher=
it;vertical-align:baseline;color:rgb(48,51,54)">=3D</span><span style=3D"fo=
nt-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inhe=
rit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:r=
gb(48,51,54)"> b</span><span style=3D"font-style:inherit;font-variant:inher=
it;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family=
:inherit;vertical-align:baseline;color:rgb(48,51,54)">;</span><span style=
=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretc=
h:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;c=
olor:rgb(48,51,54)">
b </span><span style=3D"font-style:inherit;font-variant:inherit;fon=
t-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inher=
it;vertical-align:baseline;color:rgb(48,51,54)">+=3D</span><span style=3D"f=
ont-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inh=
erit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:=
rgb(48,51,54)"> t</span><span style=3D"font-style:inherit;font-variant:inhe=
rit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-famil=
y:inherit;vertical-align:baseline;color:rgb(48,51,54)">;</span><span style=
=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretc=
h:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;c=
olor:rgb(48,51,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weig=
ht:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;ver=
tical-align:baseline;color:rgb(48,51,54)">}</span><span style=3D"font-style=
:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line=
-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb(48,51=
,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weig=
ht:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;ver=
tical-align:baseline;color:rgb(16,16,148)">return</span><span style=3D"font=
-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inheri=
t;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb=
(48,51,54)"> b</span><span style=3D"font-style:inherit;font-variant:inherit=
;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:i=
nherit;vertical-align:baseline;color:rgb(48,51,54)">;</span><span style=3D"=
font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:in=
herit;line-height:inherit;font-family:inherit;vertical-align:baseline;color=
:rgb(48,51,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weight:i=
nherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertica=
l-align:baseline;color:rgb(48,51,54)">}</span></code></pre></div><span><fon=
t color=3D"#888888"><br><br></font></span></div></div><span><font color=3D"=
#888888">
<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"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
YDNpRvrBCAAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D'javascript:&=
#39;;return true;" onclick=3D"this.href=3D'javascript:';return true=
;">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"YDNpRvrBCAAJ" rel=3D"nofollow" onmousedown=3D"=
this.href=3D'javascript:';return true;" onclick=3D"this.href=3D'=
;javascript:';return true;">std-pr...@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/04c505a2-27ff-47bf-8678-2f4f2906415b%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank" =
rel=3D"nofollow" onmousedown=3D"this.href=3D'https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/04c505a2-27ff-47bf-8678-2f4f2906415b%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter';return true;" on=
click=3D"this.href=3D'https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/04c505a2-27ff-47bf-8678-2f4f2906415b%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter';return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/04c505a2-27ff-47bf-<wbr>8678-=
2f4f2906415b%40isocpp.org</a><wbr>.<br>
</font></span></blockquote></div><br></div>
</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/440630e7-23e5-404c-a59e-fd33f30ee4b7%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/440630e7-23e5-404c-a59e-fd33f30ee4b7=
%40isocpp.org</a>.<br />
------=_Part_22757_114631271.1530096963045--
------=_Part_22756_1034680622.1530096963045--
.
Author: Jake Arkinstall <jake.arkinstall@gmail.com>
Date: Wed, 27 Jun 2018 12:16:23 +0100
Raw View
--000000000000633221056f9dbf26
Content-Type: text/plain; charset="UTF-8"
What is the benefit of renaming it, though?
"constexpr" makes more sense as a name in the context of C++. We already
use the word "pure" in the context of virtual functions, though in
nomenclature rather than as a keyword. Constexpr is already heavily used.
Put all of this together and you have yourself a rather large uphill
struggle just to change a word. It's just be easier to use a C preprocessor
#define.
I do agree that it would have made more sense to have used a better keyword
than "constexpr", but there are lots of things that would have made more
sense to do differently in the beginning. One cannot take a scrambled egg
and put it back in the shell without considerable mess.
On Wed, 27 Jun 2018, 11:56 , <ojcraftter@gmail.com> wrote:
> basically, I want to rename constexpr in function context to pure to
> underline the fact that it needs to be a basiclly functional pure function
>
> Am Mittwoch, 27. Juni 2018 08:05:40 UTC+2 schrieb Justin Bassett:
>>
>> So effectively, you want to standardize GCC's [[gnu::pure]] or
>> [[gnu::const]] (docs
>> <https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes>).
>> Or are you looking for something different?
>>
>> On Tue, Jun 26, 2018 at 10:42 PM, <ojcra...@gmail.com> wrote:
>>
>>>
>>> int fib(int n) pure
>>> {
>>>
>>> int a{ 0 };
>>> int b{ 1 };
>>> while (n-- > 1)
>>> {
>>> const int t{ a };
>>> a = b;
>>> b += t;
>>> }
>>> return b;}
>>>
>>>
>>>
>>> --
>>> 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-proposal...@isocpp.org.
>>> To post to this group, send email to std-pr...@isocpp.org.
>>> To view this discussion on the web visit
>>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/04c505a2-27ff-47bf-8678-2f4f2906415b%40isocpp.org
>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/04c505a2-27ff-47bf-8678-2f4f2906415b%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/440630e7-23e5-404c-a59e-fd33f30ee4b7%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/440630e7-23e5-404c-a59e-fd33f30ee4b7%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/CAC%2B0CCNSpJq_WL%3Dr%2Bono%2BeuwqrMCBNn%3D1m1UO7npVBVVhGfcJg%40mail.gmail.com.
--000000000000633221056f9dbf26
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"auto">What is the benefit of renaming it, though?<div dir=3D"au=
to"><br></div><div dir=3D"auto">"constexpr" makes more sense as a=
name in the context of C++. We already use the word "pure" in th=
e context of virtual functions, though in nomenclature rather than as a key=
word. Constexpr is already heavily used.</div><div dir=3D"auto"><br></div><=
div dir=3D"auto">Put all of this together and you have yourself a rather la=
rge uphill struggle just to change a word. It's just be easier to use a=
C preprocessor #define.</div><div dir=3D"auto"><br></div><div dir=3D"auto"=
>I do agree that it would have made more sense to have used a better keywor=
d than "constexpr", but there are lots of things that would have =
made more sense to do differently in the beginning. One cannot take a scram=
bled egg and put it back in the shell without considerable mess.</div></div=
><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Wed, 27 Jun 2018, 11:56=
, <<a href=3D"mailto:ojcraftter@gmail.com">ojcraftter@gmail.com</a>>=
wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8=
ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">basically,=
I want to rename constexpr in function context to pure to underline the fa=
ct that it needs to be a basiclly functional pure function<br><br>Am Mittwo=
ch, 27. Juni 2018 08:05:40 UTC+2 schrieb Justin Bassett:<blockquote class=
=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc s=
olid;padding-left:1ex"><div dir=3D"ltr">So effectively, you want to standar=
dize GCC's [[gnu::pure]] or [[gnu::const]] (<a href=3D"https://gcc.gnu.=
org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attribut=
es" rel=3D"nofollow noreferrer" target=3D"_blank">docs</a>). Or are you loo=
king for something different?</div><div><br><div class=3D"gmail_quote">On T=
ue, Jun 26, 2018 at 10:42 PM, <span dir=3D"ltr"><<a rel=3D"nofollow nor=
eferrer">ojcra...@gmail.com</a>></span> wrote:<br><blockquote class=3D"g=
mail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-l=
eft:1ex"><div dir=3D"ltr"><div><div style=3D"background-color:rgb(250,250,2=
50);border-color:rgb(187,187,187);border-style:solid;border-width:1px;word-=
wrap:break-word"><code><div><span style=3D"color:#000"><br></span><span sty=
le=3D"color:#008">int</span><span style=3D"color:#000"> fib</span><span sty=
le=3D"color:#660">(</span><span style=3D"color:#008">int</span><span style=
=3D"color:#000"> n</span><span style=3D"color:#660">)</span><span style=3D"=
color:#000"> pure<br></span><span style=3D"color:#660">{</span></div></code=
><pre style=3D"margin-bottom:1em;padding:5px;font-stretch:inherit;line-heig=
ht:inherit;font-family:Consolas,Menlo,Monaco,"Lucida Console",&qu=
ot;Liberation Mono","DejaVu Sans Mono","Bitstream Vera =
Sans Mono","Courier New",monospace,sans-serif;vertical-align=
:baseline;width:auto;max-height:600px;overflow:auto;background-color:rgb(23=
9,240,241);color:rgb(57,51,24);word-wrap:normal"><code style=3D"font-style:=
inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-=
height:inherit;font-family:Consolas,Menlo,Monaco,"Lucida Console"=
,"Liberation Mono","DejaVu Sans Mono","Bitstream V=
era Sans Mono","Courier New",monospace,sans-serif;vertical-a=
lign:baseline;white-space:inherit"><span style=3D"font-style:inherit;font-v=
ariant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit=
;font-family:inherit;vertical-align:baseline;color:rgb(48,51,54)"> </spa=
n><span style=3D"font-style:inherit;font-variant:inherit;font-weight:inheri=
t;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-ali=
gn:baseline;color:rgb(43,145,175)">int</span><span style=3D"font-style:inhe=
rit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-heig=
ht:inherit;font-family:inherit;vertical-align:baseline;color:rgb(48,51,54)"=
> a{ </span><span style=3D"font-style:inherit;font-variant:inherit;font-wei=
ght:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;ve=
rtical-align:baseline;color:rgb(125,39,39)">0 }</span><span style=3D"font-s=
tyle:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;=
line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb(4=
8,51,54)">;</span><span style=3D"font-style:inherit;font-variant:inherit;fo=
nt-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inhe=
rit;vertical-align:baseline;color:rgb(48,51,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weig=
ht:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;ver=
tical-align:baseline;color:rgb(43,145,175)">int</span><span style=3D"font-s=
tyle:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;=
line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb(4=
8,51,54)"> b{</span><span style=3D"font-style:inherit;font-variant:inherit;=
font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:in=
herit;vertical-align:baseline;color:rgb(48,51,54)"> </span><span style=3D"f=
ont-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inh=
erit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:=
rgb(125,39,39)">1 }</span><span style=3D"font-style:inherit;font-variant:in=
herit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-fam=
ily:inherit;vertical-align:baseline;color:rgb(48,51,54)">;</span><span styl=
e=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stret=
ch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;=
color:rgb(48,51,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weig=
ht:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;ver=
tical-align:baseline;color:rgb(16,16,148)">while</span><span style=3D"font-=
style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit=
;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb(=
48,51,54)"> </span><span style=3D"font-style:inherit;font-variant:inherit;f=
ont-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inh=
erit;vertical-align:baseline;color:rgb(48,51,54)">(</span><span style=3D"fo=
nt-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inhe=
rit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:r=
gb(48,51,54)">n</span><span style=3D"font-style:inherit;font-variant:inheri=
t;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:=
inherit;vertical-align:baseline;color:rgb(48,51,54)">--</span><span style=
=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretc=
h:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;c=
olor:rgb(48,51,54)"> </span><span style=3D"font-style:inherit;font-variant:=
inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-f=
amily:inherit;vertical-align:baseline;color:rgb(48,51,54)">></span><span=
style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-=
stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:base=
line;color:rgb(48,51,54)"> </span><span style=3D"font-style:inherit;font-va=
riant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;=
font-family:inherit;vertical-align:baseline;color:rgb(125,39,39)">1</span><=
span style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;f=
ont-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:=
baseline;color:rgb(48,51,54)">)<br></span><span style=3D"font-style:inherit=
;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:=
inherit;font-family:inherit;vertical-align:baseline;color:rgb(48,51,54)"> =
{</span><span style=3D"font-style:inherit;font-variant:inherit;font-weigh=
t:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vert=
ical-align:baseline;color:rgb(48,51,54)">
const </span><span style=3D"font-style:inherit;font-variant:inherit=
;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:i=
nherit;vertical-align:baseline;color:rgb(43,145,175)">int</span><span style=
=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretc=
h:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;c=
olor:rgb(48,51,54)"> t{ </span><span style=3D"font-style:inherit;font-varia=
nt:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;fon=
t-family:inherit;vertical-align:baseline;color:rgb(48,51,54)">a }</span><sp=
an style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;fon=
t-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:ba=
seline;color:rgb(48,51,54)">;</span><span style=3D"font-style:inherit;font-=
variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inheri=
t;font-family:inherit;vertical-align:baseline;color:rgb(48,51,54)">
a </span><span style=3D"font-style:inherit;font-variant:inherit;fon=
t-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inher=
it;vertical-align:baseline;color:rgb(48,51,54)">=3D</span><span style=3D"fo=
nt-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inhe=
rit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:r=
gb(48,51,54)"> b</span><span style=3D"font-style:inherit;font-variant:inher=
it;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family=
:inherit;vertical-align:baseline;color:rgb(48,51,54)">;</span><span style=
=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretc=
h:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;c=
olor:rgb(48,51,54)">
b </span><span style=3D"font-style:inherit;font-variant:inherit;fon=
t-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inher=
it;vertical-align:baseline;color:rgb(48,51,54)">+=3D</span><span style=3D"f=
ont-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inh=
erit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:=
rgb(48,51,54)"> t</span><span style=3D"font-style:inherit;font-variant:inhe=
rit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-famil=
y:inherit;vertical-align:baseline;color:rgb(48,51,54)">;</span><span style=
=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretc=
h:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;c=
olor:rgb(48,51,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weig=
ht:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;ver=
tical-align:baseline;color:rgb(48,51,54)">}</span><span style=3D"font-style=
:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line=
-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb(48,51=
,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weig=
ht:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;ver=
tical-align:baseline;color:rgb(16,16,148)">return</span><span style=3D"font=
-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inheri=
t;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb=
(48,51,54)"> b</span><span style=3D"font-style:inherit;font-variant:inherit=
;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:i=
nherit;vertical-align:baseline;color:rgb(48,51,54)">;</span><span style=3D"=
font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:in=
herit;line-height:inherit;font-family:inherit;vertical-align:baseline;color=
:rgb(48,51,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weight:i=
nherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertica=
l-align:baseline;color:rgb(48,51,54)">}</span></code></pre></div><span><fon=
t color=3D"#888888"><br><br></font></span></div></div><span><font color=3D"=
#888888">
<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 rel=3D"nofollow noreferrer">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow noreferrer">std-pr.=
...@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/04c505a2-27ff-47bf-8678-2f4f2906415b%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" rel=3D"nofollow no=
referrer" target=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/=
std-proposals/04c505a2-27ff-47bf-8678-2f4f2906415b%40isocpp.org</a>.<br>
</font></span></blockquote></div><br></div>
</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" 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/440630e7-23e5-404c-a59e-fd33f30ee4b7%=
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/440630e7-23e5-404c-a59e-fd33f30ee4b7%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/CAC%2B0CCNSpJq_WL%3Dr%2Bono%2BeuwqrMC=
BNn%3D1m1UO7npVBVVhGfcJg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Df=
ooter">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0=
CCNSpJq_WL%3Dr%2Bono%2BeuwqrMCBNn%3D1m1UO7npVBVVhGfcJg%40mail.gmail.com</a>=
..<br />
--000000000000633221056f9dbf26--
.
Author: Chris DeVisser <chris.n.devisser@gmail.com>
Date: Wed, 27 Jun 2018 05:05:40 -0700 (PDT)
Raw View
------=_Part_27174_1771495423.1530101140599
Content-Type: multipart/alternative;
boundary="----=_Part_27175_248974871.1530101140599"
------=_Part_27175_248974871.1530101140599
Content-Type: text/plain; charset="UTF-8"
On Wednesday, June 27, 2018 at 6:56:03 AM UTC-4, ojcra...@gmail.com wrote:
>
> basically, I want to rename constexpr in function context to pure to
> underline the fact that it needs to be a basiclly functional pure function
>
> Am Mittwoch, 27. Juni 2018 08:05:40 UTC+2 schrieb Justin Bassett:
>>
>> So effectively, you want to standardize GCC's [[gnu::pure]] or
>> [[gnu::const]] (docs
>> <https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes>).
>> Or are you looking for something different?
>>
>> On Tue, Jun 26, 2018 at 10:42 PM, <ojcra...@gmail.com> wrote:
>>
>>>
>>> int fib(int n) pure
>>> {
>>>
>>> int a{ 0 };
>>> int b{ 1 };
>>> while (n-- > 1)
>>> {
>>> const int t{ a };
>>> a = b;
>>> b += t;
>>> }
>>> return b;}
>>>
>>>
>>>
>>> --
>>> 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-proposal...@isocpp.org.
>>> To post to this group, send email to std-pr...@isocpp.org.
>>> To view this discussion on the web visit
>>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/04c505a2-27ff-47bf-8678-2f4f2906415b%40isocpp.org
>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/04c505a2-27ff-47bf-8678-2f4f2906415b%40isocpp.org?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
Putting aside the very high motivation needed for renaming this, constexpr
doesn't imply pure in the first place. For example, this is a perfectly
valid constexpr function:
constexpr void set(int& r) {
r = 2;
}
--
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/c5c43e48-6fa8-44ba-870c-87f1e20dd23c%40isocpp.org.
------=_Part_27175_248974871.1530101140599
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Wednesday, June 27, 2018 at 6:56:03 AM UTC-4, ojcra...@=
gmail.com 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"lt=
r">basically, I want to rename constexpr in function context to pure to und=
erline the fact that it needs to be a basiclly functional pure function<br>=
<br>Am Mittwoch, 27. Juni 2018 08:05:40 UTC+2 schrieb Justin Bassett:<block=
quote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left=
:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">So effectively, you want=
to standardize GCC's [[gnu::pure]] or [[gnu::const]] (<a href=3D"https=
://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Functi=
on-Attributes" rel=3D"nofollow" target=3D"_blank" onmousedown=3D"this.href=
=3D'https://www.google.com/url?q\x3dhttps%3A%2F%2Fgcc.gnu.org%2Fonlined=
ocs%2Fgcc%2FCommon-Function-Attributes.html%23Common-Function-Attributes\x2=
6sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGPLdy0Bgy4kkIUdPYzmjPOouVAJw';ret=
urn true;" onclick=3D"this.href=3D'https://www.google.com/url?q\x3dhttp=
s%3A%2F%2Fgcc.gnu.org%2Fonlinedocs%2Fgcc%2FCommon-Function-Attributes.html%=
23Common-Function-Attributes\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGPLdy0=
Bgy4kkIUdPYzmjPOouVAJw';return true;">docs</a>). Or are you looking for=
something different?</div><div><br><div class=3D"gmail_quote">On Tue, Jun =
26, 2018 at 10:42 PM, <span dir=3D"ltr"><<a rel=3D"nofollow">ojcra...@g=
mail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"ltr"><div><div style=3D"background-color:rgb(250,250,250);border-color:=
rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:break-word">=
<code><div><span style=3D"color:#000"><br></span><span style=3D"color:#008"=
>int</span><span style=3D"color:#000"> fib</span><span style=3D"color:#660"=
>(</span><span style=3D"color:#008">int</span><span style=3D"color:#000"> n=
</span><span style=3D"color:#660">)</span><span style=3D"color:#000"> pure<=
br></span><span style=3D"color:#660">{</span></div></code><pre style=3D"mar=
gin-bottom:1em;padding:5px;font-stretch:inherit;line-height:inherit;font-fa=
mily:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono=
","DejaVu Sans Mono","Bitstream Vera Sans Mono",&q=
uot;Courier New",monospace,sans-serif;vertical-align:baseline;width:au=
to;max-height:600px;overflow:auto;background-color:rgb(239,240,241);color:r=
gb(57,51,24);word-wrap:normal"><code style=3D"font-style:inherit;font-varia=
nt:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;fon=
t-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation =
Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono"=
;,"Courier New",monospace,sans-serif;vertical-align:baseline;whit=
e-space:inherit"><span style=3D"font-style:inherit;font-variant:inherit;fon=
t-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inher=
it;vertical-align:baseline;color:rgb(48,51,54)"> </span><span style=3D"f=
ont-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inh=
erit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:=
rgb(43,145,175)">int</span><span style=3D"font-style:inherit;font-variant:i=
nherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-fa=
mily:inherit;vertical-align:baseline;color:rgb(48,51,54)"> a{ </span><span =
style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-s=
tretch:inherit;line-height:inherit;font-family:inherit;vertical-align:basel=
ine;color:rgb(125,39,39)">0 }</span><span style=3D"font-style:inherit;font-=
variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inheri=
t;font-family:inherit;vertical-align:baseline;color:rgb(48,51,54)">;</span>=
<span style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;=
font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align=
:baseline;color:rgb(48,51,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weig=
ht:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;ver=
tical-align:baseline;color:rgb(43,145,175)">int</span><span style=3D"font-s=
tyle:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;=
line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb(4=
8,51,54)"> b{</span><span style=3D"font-style:inherit;font-variant:inherit;=
font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:in=
herit;vertical-align:baseline;color:rgb(48,51,54)"> </span><span style=3D"f=
ont-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inh=
erit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:=
rgb(125,39,39)">1 }</span><span style=3D"font-style:inherit;font-variant:in=
herit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-fam=
ily:inherit;vertical-align:baseline;color:rgb(48,51,54)">;</span><span styl=
e=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stret=
ch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;=
color:rgb(48,51,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weig=
ht:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;ver=
tical-align:baseline;color:rgb(16,16,148)">while</span><span style=3D"font-=
style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit=
;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb(=
48,51,54)"> </span><span style=3D"font-style:inherit;font-variant:inherit;f=
ont-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inh=
erit;vertical-align:baseline;color:rgb(48,51,54)">(</span><span style=3D"fo=
nt-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inhe=
rit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:r=
gb(48,51,54)">n</span><span style=3D"font-style:inherit;font-variant:inheri=
t;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:=
inherit;vertical-align:baseline;color:rgb(48,51,54)">--</span><span style=
=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretc=
h:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;c=
olor:rgb(48,51,54)"> </span><span style=3D"font-style:inherit;font-variant:=
inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-f=
amily:inherit;vertical-align:baseline;color:rgb(48,51,54)">></span><span=
style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-=
stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:base=
line;color:rgb(48,51,54)"> </span><span style=3D"font-style:inherit;font-va=
riant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;=
font-family:inherit;vertical-align:baseline;color:rgb(125,39,39)">1</span><=
span style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;f=
ont-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:=
baseline;color:rgb(48,51,54)">)<br></span><span style=3D"font-style:inherit=
;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:=
inherit;font-family:inherit;vertical-align:baseline;color:rgb(48,51,54)"> =
{</span><span style=3D"font-style:inherit;font-variant:inherit;font-weigh=
t:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vert=
ical-align:baseline;color:rgb(48,51,54)">
const </span><span style=3D"font-style:inherit;font-variant:inherit=
;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:i=
nherit;vertical-align:baseline;color:rgb(43,145,175)">int</span><span style=
=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretc=
h:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;c=
olor:rgb(48,51,54)"> t{ </span><span style=3D"font-style:inherit;font-varia=
nt:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;fon=
t-family:inherit;vertical-align:baseline;color:rgb(48,51,54)">a }</span><sp=
an style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;fon=
t-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:ba=
seline;color:rgb(48,51,54)">;</span><span style=3D"font-style:inherit;font-=
variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inheri=
t;font-family:inherit;vertical-align:baseline;color:rgb(48,51,54)">
a </span><span style=3D"font-style:inherit;font-variant:inherit;fon=
t-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inher=
it;vertical-align:baseline;color:rgb(48,51,54)">=3D</span><span style=3D"fo=
nt-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inhe=
rit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:r=
gb(48,51,54)"> b</span><span style=3D"font-style:inherit;font-variant:inher=
it;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family=
:inherit;vertical-align:baseline;color:rgb(48,51,54)">;</span><span style=
=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretc=
h:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;c=
olor:rgb(48,51,54)">
b </span><span style=3D"font-style:inherit;font-variant:inherit;fon=
t-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inher=
it;vertical-align:baseline;color:rgb(48,51,54)">+=3D</span><span style=3D"f=
ont-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inh=
erit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:=
rgb(48,51,54)"> t</span><span style=3D"font-style:inherit;font-variant:inhe=
rit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-famil=
y:inherit;vertical-align:baseline;color:rgb(48,51,54)">;</span><span style=
=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretc=
h:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;c=
olor:rgb(48,51,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weig=
ht:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;ver=
tical-align:baseline;color:rgb(48,51,54)">}</span><span style=3D"font-style=
:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line=
-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb(48,51=
,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weig=
ht:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;ver=
tical-align:baseline;color:rgb(16,16,148)">return</span><span style=3D"font=
-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inheri=
t;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb=
(48,51,54)"> b</span><span style=3D"font-style:inherit;font-variant:inherit=
;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:i=
nherit;vertical-align:baseline;color:rgb(48,51,54)">;</span><span style=3D"=
font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:in=
herit;line-height:inherit;font-family:inherit;vertical-align:baseline;color=
:rgb(48,51,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weight:i=
nherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertica=
l-align:baseline;color:rgb(48,51,54)">}</span></code></pre></div><span><fon=
t color=3D"#888888"><br><br></font></span></div></div><span><font color=3D"=
#888888">
<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 rel=3D"nofollow">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow">std-pr...@isocpp.o=
rg</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/04c505a2-27ff-47bf-8678-2f4f2906415b%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" rel=3D"nofollow" t=
arget=3D"_blank" onmousedown=3D"this.href=3D'https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/04c505a2-27ff-47bf-8678-2f4f2906415b%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter';return true;" on=
click=3D"this.href=3D'https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/04c505a2-27ff-47bf-8678-2f4f2906415b%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter';return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/04c505a2-27ff-47bf-<wbr>8678-=
2f4f2906415b%40isocpp.org</a><wbr>.<br>
</font></span></blockquote></div><br></div></blockquote></div></blockquote>=
<div><br></div><div>Putting aside the very high motivation needed for renam=
ing this, constexpr doesn't imply pure in the first place. For example,=
this is a perfectly valid constexpr function:</div><div><br></div><div><di=
v class=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250); bord=
er-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; overf=
low-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"subprettyp=
rint"><span style=3D"color: #008;" class=3D"styled-by-prettify">constexpr</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">void</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"colo=
r: #008;" class=3D"styled-by-prettify">set</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">(</span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">int</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">&</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> r</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">)</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><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 r </s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">2</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">}</span></div></code></div><span class=3D"styled-by=
-prettify" style=3D"font-family: monospace; background-color: rgb(250, 250,=
250); color: rgb(102, 102, 0);"><br></span><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/c5c43e48-6fa8-44ba-870c-87f1e20dd23c%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/c5c43e48-6fa8-44ba-870c-87f1e20dd23c=
%40isocpp.org</a>.<br />
------=_Part_27175_248974871.1530101140599--
------=_Part_27174_1771495423.1530101140599--
.
Author: florian.csdt@gmail.com
Date: Wed, 27 Jun 2018 05:35:25 -0700 (PDT)
Raw View
------=_Part_36625_899655115.1530102925581
Content-Type: multipart/alternative;
boundary="----=_Part_36626_1601476629.1530102925582"
------=_Part_36626_1601476629.1530102925582
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Le mercredi 27 juin 2018 14:05:40 UTC+2, Chris DeVisser a =C3=A9crit :
>
> On Wednesday, June 27, 2018 at 6:56:03 AM UTC-4, ojcra...@gmail.com wrote=
:
>>
>> basically, I want to rename constexpr in function context to pure to=20
>> underline the fact that it needs to be a basiclly functional pure functi=
on
>>
>> Am Mittwoch, 27. Juni 2018 08:05:40 UTC+2 schrieb Justin Bassett:
>>>
>>> So effectively, you want to standardize GCC's [[gnu::pure]] or=20
>>> [[gnu::const]] (docs=20
>>> <https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Com=
mon-Function-Attributes>).=20
>>> Or are you looking for something different?
>>>
>>> On Tue, Jun 26, 2018 at 10:42 PM, <ojcra...@gmail.com> wrote:
>>>
>>>>
>>>> int fib(int n) pure
>>>> {
>>>>
>>>> int a{ 0 };
>>>> int b{ 1 };
>>>> while (n-- > 1)
>>>> {
>>>> const int t{ a };
>>>> a =3D b;
>>>> b +=3D t;
>>>> }
>>>> return b;}
>>>>
>>>>
>>>>
>>>> --=20
>>>> You received this message because you are subscribed to the Google=20
>>>> Groups "ISO C++ Standard - Future Proposals" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send=
=20
>>>> an email to std-proposal...@isocpp.org.
>>>> To post to this group, send email to std-pr...@isocpp.org.
>>>> To view this discussion on the web visit=20
>>>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/04c505a2-=
27ff-47bf-8678-2f4f2906415b%40isocpp.org=20
>>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/04c505a2=
-27ff-47bf-8678-2f4f2906415b%40isocpp.org?utm_medium=3Demail&utm_source=3Df=
ooter>
>>>> .
>>>>
>>>
>>>
> Putting aside the very high motivation needed for renaming this, constexp=
r=20
> doesn't imply pure in the first place. For example, this is a perfectly=
=20
> valid constexpr function:
>
> constexpr void set(int& r) {
> r =3D 2;
> }
>
>
>
I would also add: there is no reason to say a pure function is necessarily =
=20
constexpr:
int fibo(int n) pure {
static std::vector<int> cache({0, 1});
if (n < cache.size()) return cache[n];
cache.reserve(n+1);
int f =3D fibo(n-2) + fibo(n-1);
cache.push_back(f);
return f;
}
A pure function is just a function whose output depends only on its input.
That means if you call it multiple times with the same input, you are=20
guaranteed to have the exact same output every single time.
But that doesn't say much about accessing global state (for caching purpose=
=20
for instance).
I assumed, like most people, that what you call pure is the equivalent to=
=20
__attribute__((pure)), which is not the same as __attribute__((const)).
--=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/14a71d9c-ec27-4cd9-8196-438ec2eb1284%40isocpp.or=
g.
------=_Part_36626_1601476629.1530102925582
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>Le mercredi 27 juin 2018 14:05:40 UTC+2, Chris DeV=
isser a =C3=A9crit=C2=A0:<blockquote class=3D"gmail_quote" style=3D"margin:=
0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div =
dir=3D"ltr">On Wednesday, June 27, 2018 at 6:56:03 AM UTC-4, <a>ojcra...@gm=
ail.com</a> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margi=
n-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">=
basically, I want to rename constexpr in function context to pure to underl=
ine the fact that it needs to be a basiclly functional pure function<br><br=
>Am Mittwoch, 27. Juni 2018 08:05:40 UTC+2 schrieb Justin Bassett:<blockquo=
te class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">So effectively, you want to=
standardize GCC's [[gnu::pure]] or [[gnu::const]] (<a href=3D"https://=
gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-=
Attributes" rel=3D"nofollow" target=3D"_blank" onmousedown=3D"this.href=3D&=
#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgcc.gnu.org%2Fonlinedocs%=
2Fgcc%2FCommon-Function-Attributes.html%23Common-Function-Attributes\x26sa\=
x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGPLdy0Bgy4kkIUdPYzmjPOouVAJw';return =
true;" onclick=3D"this.href=3D'https://www.google.com/url?q\x3dhttps%3A=
%2F%2Fgcc.gnu.org%2Fonlinedocs%2Fgcc%2FCommon-Function-Attributes.html%23Co=
mmon-Function-Attributes\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGPLdy0Bgy4=
kkIUdPYzmjPOouVAJw';return true;">docs</a>). Or are you looking for som=
ething different?</div><div><br><div class=3D"gmail_quote">On Tue, Jun 26, =
2018 at 10:42 PM, <span dir=3D"ltr"><<a rel=3D"nofollow">ojcra...@gmail=
..com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"lt=
r"><div><div style=3D"background-color:rgb(250,250,250);border-color:rgb(18=
7,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>=
<div><span style=3D"color:#000"><br></span><span style=3D"color:#008">int</=
span><span style=3D"color:#000"> fib</span><span style=3D"color:#660">(</sp=
an><span style=3D"color:#008">int</span><span style=3D"color:#000"> n</span=
><span style=3D"color:#660">)</span><span style=3D"color:#000"> pure<br></s=
pan><span style=3D"color:#660">{</span></div></code><pre style=3D"margin-bo=
ttom:1em;padding:5px;font-stretch:inherit;line-height:inherit;font-family:C=
onsolas,Menlo,Monaco,"Lucida Console","Liberation Mono"=
,"DejaVu Sans Mono","Bitstream Vera Sans Mono","Co=
urier New",monospace,sans-serif;vertical-align:baseline;width:auto;max=
-height:600px;overflow:auto;background-color:rgb(239,240,241);color:rgb(57,=
51,24);word-wrap:normal"><code style=3D"font-style:inherit;font-variant:inh=
erit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-fami=
ly:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono&q=
uot;,"DejaVu Sans Mono","Bitstream Vera Sans Mono",&quo=
t;Courier New",monospace,sans-serif;vertical-align:baseline;white-spac=
e:inherit"><span style=3D"font-style:inherit;font-variant:inherit;font-weig=
ht:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;ver=
tical-align:baseline;color:rgb(48,51,54)"> </span><span style=3D"font-st=
yle:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;l=
ine-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb(43=
,145,175)">int</span><span style=3D"font-style:inherit;font-variant:inherit=
;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:i=
nherit;vertical-align:baseline;color:rgb(48,51,54)"> a{ </span><span style=
=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretc=
h:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;c=
olor:rgb(125,39,39)">0 }</span><span style=3D"font-style:inherit;font-varia=
nt:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;fon=
t-family:inherit;vertical-align:baseline;color:rgb(48,51,54)">;</span><span=
style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-=
stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:base=
line;color:rgb(48,51,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weig=
ht:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;ver=
tical-align:baseline;color:rgb(43,145,175)">int</span><span style=3D"font-s=
tyle:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;=
line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb(4=
8,51,54)"> b{</span><span style=3D"font-style:inherit;font-variant:inherit;=
font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:in=
herit;vertical-align:baseline;color:rgb(48,51,54)"> </span><span style=3D"f=
ont-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inh=
erit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:=
rgb(125,39,39)">1 }</span><span style=3D"font-style:inherit;font-variant:in=
herit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-fam=
ily:inherit;vertical-align:baseline;color:rgb(48,51,54)">;</span><span styl=
e=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stret=
ch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;=
color:rgb(48,51,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weig=
ht:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;ver=
tical-align:baseline;color:rgb(16,16,148)">while</span><span style=3D"font-=
style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit=
;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb(=
48,51,54)"> </span><span style=3D"font-style:inherit;font-variant:inherit;f=
ont-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inh=
erit;vertical-align:baseline;color:rgb(48,51,54)">(</span><span style=3D"fo=
nt-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inhe=
rit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:r=
gb(48,51,54)">n</span><span style=3D"font-style:inherit;font-variant:inheri=
t;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:=
inherit;vertical-align:baseline;color:rgb(48,51,54)">--</span><span style=
=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretc=
h:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;c=
olor:rgb(48,51,54)"> </span><span style=3D"font-style:inherit;font-variant:=
inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-f=
amily:inherit;vertical-align:baseline;color:rgb(48,51,54)">></span><span=
style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-=
stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:base=
line;color:rgb(48,51,54)"> </span><span style=3D"font-style:inherit;font-va=
riant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;=
font-family:inherit;vertical-align:baseline;color:rgb(125,39,39)">1</span><=
span style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;f=
ont-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:=
baseline;color:rgb(48,51,54)">)<br></span><span style=3D"font-style:inherit=
;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:=
inherit;font-family:inherit;vertical-align:baseline;color:rgb(48,51,54)"> =
{</span><span style=3D"font-style:inherit;font-variant:inherit;font-weigh=
t:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vert=
ical-align:baseline;color:rgb(48,51,54)">
const </span><span style=3D"font-style:inherit;font-variant:inherit=
;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:i=
nherit;vertical-align:baseline;color:rgb(43,145,175)">int</span><span style=
=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretc=
h:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;c=
olor:rgb(48,51,54)"> t{ </span><span style=3D"font-style:inherit;font-varia=
nt:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;fon=
t-family:inherit;vertical-align:baseline;color:rgb(48,51,54)">a }</span><sp=
an style=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;fon=
t-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:ba=
seline;color:rgb(48,51,54)">;</span><span style=3D"font-style:inherit;font-=
variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inheri=
t;font-family:inherit;vertical-align:baseline;color:rgb(48,51,54)">
a </span><span style=3D"font-style:inherit;font-variant:inherit;fon=
t-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inher=
it;vertical-align:baseline;color:rgb(48,51,54)">=3D</span><span style=3D"fo=
nt-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inhe=
rit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:r=
gb(48,51,54)"> b</span><span style=3D"font-style:inherit;font-variant:inher=
it;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family=
:inherit;vertical-align:baseline;color:rgb(48,51,54)">;</span><span style=
=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretc=
h:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;c=
olor:rgb(48,51,54)">
b </span><span style=3D"font-style:inherit;font-variant:inherit;fon=
t-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inher=
it;vertical-align:baseline;color:rgb(48,51,54)">+=3D</span><span style=3D"f=
ont-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inh=
erit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:=
rgb(48,51,54)"> t</span><span style=3D"font-style:inherit;font-variant:inhe=
rit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-famil=
y:inherit;vertical-align:baseline;color:rgb(48,51,54)">;</span><span style=
=3D"font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretc=
h:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;c=
olor:rgb(48,51,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weig=
ht:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;ver=
tical-align:baseline;color:rgb(48,51,54)">}</span><span style=3D"font-style=
:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line=
-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb(48,51=
,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weig=
ht:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;ver=
tical-align:baseline;color:rgb(16,16,148)">return</span><span style=3D"font=
-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inheri=
t;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb=
(48,51,54)"> b</span><span style=3D"font-style:inherit;font-variant:inherit=
;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:i=
nherit;vertical-align:baseline;color:rgb(48,51,54)">;</span><span style=3D"=
font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:in=
herit;line-height:inherit;font-family:inherit;vertical-align:baseline;color=
:rgb(48,51,54)">
</span><span style=3D"font-style:inherit;font-variant:inherit;font-weight:i=
nherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertica=
l-align:baseline;color:rgb(48,51,54)">}</span></code></pre></div><span><fon=
t color=3D"#888888"><br><br></font></span></div></div><span><font color=3D"=
#888888">
<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 rel=3D"nofollow">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow">std-pr...@isocpp.o=
rg</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/04c505a2-27ff-47bf-8678-2f4f2906415b%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" rel=3D"nofollow" t=
arget=3D"_blank" onmousedown=3D"this.href=3D'https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/04c505a2-27ff-47bf-8678-2f4f2906415b%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter';return true;" on=
click=3D"this.href=3D'https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/04c505a2-27ff-47bf-8678-2f4f2906415b%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter';return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/04c505a2-27ff-47bf-<wbr>8678-=
2f4f2906415b%40isocpp.org</a><wbr>.<br>
</font></span></blockquote></div><br></div></blockquote></div></blockquote>=
<div><br></div><div>Putting aside the very high motivation needed for renam=
ing this, constexpr doesn't imply pure in the first place. For example,=
this is a perfectly valid constexpr function:</div><div><br></div><div><di=
v style=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);=
border-style:solid;border-width:1px"><code><div><span style=3D"color:#008">=
constexpr</span><span style=3D"color:#000"> </span><span style=3D"color:#00=
8">void</span><span style=3D"color:#000"> </span><span style=3D"color:#008"=
>set</span><span style=3D"color:#660">(</span><span style=3D"color:#008">in=
t</span><span style=3D"color:#660">&</span><span style=3D"color:#000"> =
r</span><span style=3D"color:#660">)</span><span style=3D"color:#000"> </sp=
an><span style=3D"color:#660">{</span><span style=3D"color:#000"><br>=C2=A0=
=C2=A0 r </span><span style=3D"color:#660">=3D</span><span style=3D"color:=
#000"> </span><span style=3D"color:#066">2</span><span style=3D"color:#660"=
>;</span><span style=3D"color:#000"><br></span><span style=3D"color:#660">}=
</span></div></code></div><span style=3D"font-family:monospace;background-c=
olor:rgb(250,250,250);color:rgb(102,102,0)"><br></span><br></div></div></bl=
ockquote><div><br></div><div>I would also add: there is no reason to say a =
pure function is necessarily=C2=A0 constexpr:</div><div><div style=3D"backg=
round-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-s=
tyle: solid; border-width: 1px; overflow-wrap: break-word;" class=3D"pretty=
print"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span styl=
e=3D"color: #008;" class=3D"styled-by-prettify">int</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> fibo</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #008;" cl=
ass=3D"styled-by-prettify">int</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> n</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">)</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> pure </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=
</span><span style=3D"color: #008;" class=3D"styled-by-prettify">static</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> std</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span styl=
e=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: #000;" class=3D"styled-by-prettify"> cache</span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">({</span><span style=3D"color: #=
066;" class=3D"styled-by-prettify">0</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by-pr=
ettify">1</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 </span><span style=3D"color: #008;" class=3D"styled-by-prettify">if</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify">n </span><span style=3D"color: #=
660;" class=3D"styled-by-prettify"><</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> cache</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">.</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">size</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">())</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">return=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> cache</sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">[</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify">n</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 cache</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">.</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify">reserve</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify">n</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">+</span><span style=3D"color: #066;" class=3D"styled-by-prettify=
">1</span><span style=3D"color: #660;" class=3D"styled-by-prettify">);</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 </sp=
an><span style=3D"color: #008;" class=3D"styled-by-prettify">int</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> f </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> fibo</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify">n</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">-</span><span style=3D"color: #066;" class=3D"styled-by-pr=
ettify">2</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">+</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> fibo</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify">n</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">-</span><span style=3D"color: #066;" class=3D"style=
d-by-prettify">1</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">);</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><b=
r>=C2=A0 cache</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">.</span><span style=3D"color: #000;" class=3D"styled-by-prettify">push_=
back</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify">f</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">);</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 </span><span style=3D=
"color: #008;" class=3D"styled-by-prettify">return</span><span style=3D"col=
or: #000;" class=3D"styled-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"><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></span></div></code></div></div><div><br></div><div>A pure fun=
ction is just a function whose output depends only on its input.</div><div>=
That means if you call it multiple times with the same input, you are guara=
nteed to have the exact same output every single time.</div><div>But that d=
oesn't say much about accessing global state (for caching purpose for i=
nstance).<br></div><div><br></div><div>I assumed, like most people, that wh=
at you call pure is the equivalent to __attribute__((pure)), which is not t=
he same as __attribute__((const)).<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/14a71d9c-ec27-4cd9-8196-438ec2eb1284%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/14a71d9c-ec27-4cd9-8196-438ec2eb1284=
%40isocpp.org</a>.<br />
------=_Part_36626_1601476629.1530102925582--
------=_Part_36625_899655115.1530102925581--
.