220 15617 <0098656E-0F82-4B50-A59A-F55630245AB5@gmail.com> article
Path: news.gmane.org!not-for-mail
From: David Krauss <potswa@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Library support for relaxed constexpr
Date: Tue, 13 Jan 2015 13:20:12 +0800
Lines: 135
Approved: news@gmane.org
Message-ID: <0098656E-0F82-4B50-A59A-F55630245AB5@gmail.com>
References: <5ccd3d6e-859c-4b66-b61c-317b704647f2@isocpp.org> <m91euh$u1o$1@ger.gmane.org> <14072581.09eDfPqFOs@tjmaciei-mobl4> <9F9D7F25-F862-4358-B074-8F8C87255E2A@gmail.com> <1c00c8fd-140a-42f6-b73a-628cbde1737b@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\))
Content-Type: multipart/alternative; boundary="Apple-Mail=_AC2654A7-ED28-4CEC-9B30-D2F8139AD82B"
X-Trace: ger.gmane.org 1421126436 24290 80.91.229.3 (13 Jan 2015 05:20:36 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 13 Jan 2015 05:20:36 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCW25A7E3QCRBF6W2KSQKGQEBA2ZGFQ@isocpp.org Tue Jan 13 06:20:28 2015
Return-path: <std-proposals+bncBCW25A7E3QCRBF6W2KSQKGQEBA2ZGFQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ig0-f199.google.com ([209.85.213.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCW25A7E3QCRBF6W2KSQKGQEBA2ZGFQ@isocpp.org>)
	id 1YAttx-00045q-JC
	for gclcip-std-proposals@m.gmane.org; Tue, 13 Jan 2015 06:20:25 +0100
Original-Received: by mail-ig0-f199.google.com with SMTP id l13sf8521670iga.2
        for <gclcip-std-proposals@m.gmane.org>; Mon, 12 Jan 2015 21:20:24 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:content-type:message-id:mime-version
         :subject:date:references:to:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=dCTX4aXWZOWRiaWJSlX5wfVHhPHWTG8dXENFwUTGxG8=;
        b=QaDV4jUL4xTAgOa1xWfaQygsEcUoAB26ufZmIiGhoirNDQeeIairY46yByVcOp7Wqt
         TIwfTyq553W7EffdmQHR6UtoHd8KIUsQSTWcbqIla0TyyvpIomZ22uCFU/P4u4A+55R1
         yufR6IOuqbTuUeG73dfVRWN2DEDSdIYCZJzlLWxlWEp/IRMKZ8kp7Dw1OWy6arbK+4xe
         D5pacPDlTI2/P4xDUxHoHediZJAb4/CgZ+ShEmAJVBQih7iG5j0nM4GNXmu8vvo7jZPj
         bQjE1CepfLiM6CkNu69F68us3sFhK2MmTR4LDlhJHnCbaHCIrJsdJJZTgK2jN4Rroh/z
         Bcsg==
X-Gm-Message-State: ALoCoQmGbG4LbfjHSezn9R8eppLPjJOR1MQdkfgdwiXS/PiMJ9JFo22bbMRfM0ST2a700UN3mfqe
X-Received: by 10.182.29.101 with SMTP id j5mr12464159obh.32.1421126424520;
        Mon, 12 Jan 2015 21:20:24 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.158.132 with SMTP id h126ls72576ioe.28.gmail; Mon, 12 Jan
 2015 21:20:23 -0800 (PST)
X-Received: by 10.68.196.231 with SMTP id ip7mr48487594pbc.156.1421126423606;
        Mon, 12 Jan 2015 21:20:23 -0800 (PST)
Original-Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com. [2607:f8b0:400e:c03::22c])
        by mx.google.com with ESMTPS id g1si20054506pde.233.2015.01.12.21.20.23
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Mon, 12 Jan 2015 21:20:23 -0800 (PST)
Received-SPF: pass (google.com: domain of potswa@gmail.com designates 2607:f8b0:400e:c03::22c as permitted sender) client-ip=2607:f8b0:400e:c03::22c;
Original-Received: by mail-pa0-f44.google.com with SMTP id et14so1454746pad.3
        for <std-proposals@isocpp.org>; Mon, 12 Jan 2015 21:20:23 -0800 (PST)
X-Received: by 10.70.131.78 with SMTP id ok14mr49050044pdb.112.1421126423281;
        Mon, 12 Jan 2015 21:20:23 -0800 (PST)
Original-Received: from [172.20.10.2] ([121.54.44.91])
        by mx.google.com with ESMTPSA id i7sm15815586pdp.3.2015.01.12.21.20.21
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Mon, 12 Jan 2015 21:20:22 -0800 (PST)
In-Reply-To: <1c00c8fd-140a-42f6-b73a-628cbde1737b@isocpp.org>
X-Mailer: Apple Mail (2.1993)
X-Original-Sender: potswa@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of potswa@gmail.com designates 2607:f8b0:400e:c03::22c as permitted
 sender) smtp.mail=potswa@gmail.com;       dkim=pass header.i=@gmail.com;
       dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:15617
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/15617>

--Apple-Mail=_AC2654A7-ED28-4CEC-9B30-D2F8139AD82B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 2015=E2=80=9301=E2=80=9313, at 11:54 AM, Myriachan <myriachan@gmail.co=
m> wrote:
>=20
> Is it still the case that implementations aren't allowed to declare stand=
ard functions as constexpr that are not explicitly constexpr in the Standar=
d?  What this thread is about is otherwise confusing me=E2=80=A6sorry.

Yes, it=E2=80=99s still the case. My recollection is that the restriction w=
as added by a DR which was resolved after C++11, but it might have been bef=
ore.

Considering the potential for language fragmentation, the decision is unlik=
ely to be reversed.


> On 2015=E2=80=9301=E2=80=9313, at 11:47 AM, Richard Smith <richard@metafo=
o.co.uk> wrote:
>=20
> One consideration, though: C supports controlling the floating point envi=
ronment in various ways, and C++ pays lipservice to this by providing the <=
cfenv> header. If we ever start also supporting "#pragma STDC FENV_ACCESS" =
and following the C rules here (which seems like a very bad idea, but we're=
 already half-way there) then that will have "interesting" interactions wit=
h compile-time evaluation of floating-point expressions.

Nothing that #pragma STDC FP_CONTRACT doesn=E2=80=99t already do. Such inte=
ractions are acknowledged and dealt with simply. C99/C11 =C2=A76.5/8:

> Otherwise, whether and how expressions are contracted is implementation-d=
efined. *
>=20
> * This license is specifically intended to allow implementations to explo=
it fast machine instructions that combine multiple C operators. As contract=
ions potentially undermine predictability, and can even decrease accuracy f=
or containing expressions, their use needs to be well-defined and clearly d=
ocumented.

The difference is that FP_CONTRACT can be turned off but constexpr can=E2=
=80=99t. If we set aside the C/C++ rivalry, would it be too unreasonable to=
 let <cmath> be non-constexpr when FP_CONTRACT OFF is in effect in the scop=
e enclosing the call? (Despite being a pragma, it is scoped.)

--=20

---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--Apple-Mail=_AC2654A7-ED28-4CEC-9B30-D2F8139AD82B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><br class=3D""><di=
v><blockquote type=3D"cite" class=3D""><div class=3D"">On 2015=E2=80=9301=
=E2=80=9313, at 11:54 AM, Myriachan &lt;<a href=3D"mailto:myriachan@gmail.c=
om" class=3D"">myriachan@gmail.com</a>&gt; wrote:</div><br class=3D"Apple-i=
nterchange-newline"><div class=3D""><div dir=3D"ltr" class=3D""><div class=
=3D"">Is it still the case that implementations aren't allowed to declare s=
tandard functions as <span style=3D"font-family: courier new,monospace;" cl=
ass=3D"">constexpr</span> that are not explicitly <span style=3D"font-famil=
y: courier new,monospace;" class=3D"">constexpr</span> in the Standard?&nbs=
p; What this thread is about is otherwise confusing me=E2=80=A6sorry.<br cl=
ass=3D""></div></div></div></blockquote><div><br class=3D""></div><div>Yes,=
 it=E2=80=99s still the case. My recollection is that the restriction was a=
dded by a DR which was resolved after C++11, but it might have been before.=
</div><div><br class=3D""></div><div>Considering the potential for language=
 fragmentation, the decision is unlikely to be reversed.</div><div><br clas=
s=3D""></div><div><br class=3D""></div><div><blockquote type=3D"cite" class=
=3D""><div class=3D"">On 2015=E2=80=9301=E2=80=9313, at 11:47 AM, Richard S=
mith &lt;<a href=3D"mailto:richard@metafoo.co.uk" class=3D"">richard@metafo=
o.co.uk</a>&gt; wrote:</div><br class=3D"Apple-interchange-newline"><div cl=
ass=3D""><span class=3D"" style=3D"float: none; display: inline !important;=
">One consideration, though: C supports controlling the floating point envi=
ronment in various ways, and C++ pays lipservice to this by providing the &=
lt;cfenv&gt; header. If we ever start also supporting "#pragma STDC FENV_AC=
CESS" and following the C rules here (which seems like a very bad idea, but=
 we're already half-way there) then that will have "interesting" interactio=
ns with compile-time evaluation of floating-point expressions.</span></div>=
</blockquote><div class=3D""><div class=3D""><span class=3D"" style=3D"floa=
t: none; display: inline !important;"><br class=3D""></span></div></div><di=
v class=3D""><span class=3D"" style=3D"float: none; display: inline !import=
ant;">Nothing that <font face=3D"Courier" class=3D"">#pragma STDC FP_CONTRA=
CT</font> doesn=E2=80=99t already do. Such interactions are acknowledged an=
d dealt with simply. C99/C11 =C2=A76.5/8:</span></div><div class=3D""><span=
 class=3D"" style=3D"float: none; display: inline !important;"><br class=3D=
""></span></div><div class=3D""></div><blockquote type=3D"cite" class=3D"">=
<div class=3D""><span class=3D"" style=3D"float: none; display: inline !imp=
ortant;">Otherwise, whether and how expressions are&nbsp;contracted is impl=
ementation-defined. *</span></div><div class=3D""><span class=3D"" style=3D=
"float: none; display: inline !important;"><br class=3D""></span></div><div=
 class=3D""><span class=3D"" style=3D"float: none; display: inline !importa=
nt;">*&nbsp;</span>This license is specifically intended to allow implement=
ations to exploit fast machine instructions that&nbsp;combine multiple C op=
erators. As contractions&nbsp;potentially undermine predictability, and can=
 even&nbsp;decrease accuracy for containing expressions, their use needs to=
 be well-defined and clearly&nbsp;documented.</div></blockquote><div class=
=3D""><br class=3D""></div><div class=3D"">The difference is that <font fac=
e=3D"Courier" class=3D"">FP_CONTRACT</font> can be turned off but <font fac=
e=3D"Courier" class=3D"">constexpr</font> can=E2=80=99t. If we set aside th=
e C/C++ rivalry, would it be too unreasonable to let <font face=3D"Courier"=
 class=3D"">&lt;cmath&gt;</font> be non-constexpr when <font face=3D"Courie=
r" class=3D"">FP_CONTRACT OFF</font> is in effect in the scope enclosing th=
e call? (Despite being a pragma, it is scoped.)</div></div></div></body></h=
tml>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--Apple-Mail=_AC2654A7-ED28-4CEC-9B30-D2F8139AD82B--

.
