Topic: Is std::is_constant_evaluated the right name for this feature?
Author: gmisocpp@gmail.com
Date: Wed, 12 Dec 2018 21:38:41 -0800 (PST)
Raw View
------=_Part_202_1407972041.1544679521492
Content-Type: multipart/alternative;
boundary="----=_Part_203_784246804.1544679521492"
------=_Part_203_784246804.1544679521492
Content-Type: text/plain; charset="UTF-8"
Hi Everyone
I was listening to Cpp Chat where std::is_constant_evaluated() was
suggested that maybe the Committee had chosen the wrong name for this
feature. I am inclined to agree.
I can imagine a future where C might also get constexpr and consteval
and then C code might likely exist that might expect to
compile interchangeably as C and C++ using std::is_constant_evaluated() too.
However in such a future C can't use std::is_constant_evaluated because C
does not have namespaces.
Might it be better to rename std::is_constant_evaluated to something else
that isn't in a namespace?
Maybe if (consteval()) or if (is_consteval()) ?
If we don't do this and C does get such features, C++ will come under
pressure to adopt the C version of is_constant_evaluated too for
compatibility. So shouldn't we head this off now?
Separately, I see commentary from various places that if constexpr should
not introduce a scope.
I'm interested in peoples opinions on that.
--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/b2e42916-753e-497c-a491-76e7121cfdd7%40isocpp.org.
------=_Part_203_784246804.1544679521492
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Hi Everyone</div><div><br></div><div>I was listening =
to Cpp Chat where=C2=A0std::is_constant_evaluated() was suggested that=C2=
=A0maybe the Committee had chosen the wrong name=C2=A0for this feature. I a=
m inclined to agree.</div><div><br></div><div>I can imagine a future where =
C might also get constexpr and consteval and=C2=A0then=C2=A0C code might li=
kely exist that might expect to compile=C2=A0interchangeably as C and C++=
=C2=A0using=C2=A0std::is_constant_evaluated()=C2=A0too.</div><div><br></div=
><div>However=C2=A0in such a future C can't use=C2=A0std::is_constant_e=
valuated=C2=A0because=C2=A0C does not have namespaces.</div><div><br></div>=
<div>Might it be better to rename std::is_constant_evaluated to something e=
lse that=C2=A0isn't=C2=A0in a namespace?</div><div>Maybe if (consteval(=
)) or if (is_consteval()) ?</div><div><br></div><div>If we don't do thi=
s and C does get such features, C++ will come under pressure to adopt the C=
version of is_constant_evaluated too for compatibility. So shouldn't w=
e head this off now?</div><div><br></div><div>Separately, I see commentary =
from various places that if constexpr should not introduce a scope.</div><d=
iv>I'm interested in peoples opinions on that.</div><div><br></div></di=
v>
<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/b2e42916-753e-497c-a491-76e7121cfdd7%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/b2e42916-753e-497c-a491-76e7121cfdd7=
%40isocpp.org</a>.<br />
------=_Part_203_784246804.1544679521492--
------=_Part_202_1407972041.1544679521492--
.