220 25372 <CANaLnBrZFUKbUD_90-9O_OX7waZpa1N9YtA_pNOnux00H8qUCw@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Andrei L <aendaerel@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: constexpr if, and a little bit more control
 over constexpr.
Date: Wed, 30 Mar 2016 20:20:46 +0500
Lines: 86
Approved: news@gmane.org
Message-ID: <CANaLnBrZFUKbUD_90-9O_OX7waZpa1N9YtA_pNOnux00H8qUCw@mail.gmail.com>
References: <33d19c42-848a-4952-9724-26b98790742b@isocpp.org>
	<1fdbd2bc-9f4d-479c-b987-028ef4a32d15@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=089e013cb802a35f9c052f45b062
X-Trace: ger.gmane.org 1459351259 26592 80.91.229.3 (30 Mar 2016 15:20:59 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 30 Mar 2016 15:20:59 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCO5PRHFXYFBBVG5563QKGQEM7INDMQ@isocpp.org Wed Mar 30 17:20:55 2016
Return-path: <std-proposals+bncBCO5PRHFXYFBBVG5563QKGQEM7INDMQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pf0-f197.google.com ([209.85.192.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCO5PRHFXYFBBVG5563QKGQEM7INDMQ@isocpp.org>)
	id 1alHvT-000834-6o
	for gclcip-std-proposals@m.gmane.org; Wed, 30 Mar 2016 17:20:55 +0200
Original-Received: by mail-pf0-f197.google.com with SMTP id n5sf68707973pfn.2
        for <gclcip-std-proposals@m.gmane.org>; Wed, 30 Mar 2016 08:20:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=gEE6LIxCMh4lKn/kRbLc6glq86B9RtlGoLDdOpqfKYM=;
        b=gAjWon/mIgdK59w+WUdI5osO6tQkPWieLUxeiMr0IIHsa/xxqMtfkLaD6CoTGvS8oj
         T+wRqq6PqaZRxZNhxkGugryOEtTH9fVcyGeIDnJaRxIqZFtRAVVpcxnuJndUcLhLtE9D
         VzMMPgZDyd0bV83h9Q+em+xlN4jVPqKeQh6eFh1FOGBqFygtTTXT3YLdEJVJqbNGh9Jw
         99mjNzUgHVAG02cD63EAJic1E9KUHVgCvtDe3LhCZgcgS5Q1ddPNzeYBQThPNvegYjRq
         P3L39AQBMqy23vmI4tHjSE0RjzEFbPAf0JLE79lebz3z1V6+AVTSrQY1zjGXEQiq7Kxe
         dNHA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=gEE6LIxCMh4lKn/kRbLc6glq86B9RtlGoLDdOpqfKYM=;
        b=ljjKL7jd6NzP9xXrhXY7FSAceG/tT9Z+kIGxILMcnBd6YfyqpkUyrKnjGnJUnTOIDb
         JjgUuB8l3U4bn+wwjlTx4eh47yVh+sBJ/ao/Nd3XsDund7bPOstzsGiawNSfdl600RBg
         B1nM3BJJnppNNiVO84I5Z0gCKnVan559CHXapWYfrt89Jybnj7EYUpYomGnp/2ZAIbss
         3ttzSCJY7187j0pHbNGOyJ2yUuHOnss/Gp1tr2anyZIjIXLhhtRO+eRL/vZVY0USiFyp
         1ASVu0sf7sLyVuniRR6mLAPJ6fvREFl2rbW+ZQk1lh/vqy1Ip1dzWav8ZsslxdoJJa0u
         cpMA==
X-Gm-Message-State: AD7BkJIVYHdpqlN2lqYE+jpNB+G56A1kpQVq7elz/wPLWxbeMFZyCbT6FFsxsKUab+YT2A==
X-Received: by 10.98.44.215 with SMTP id s206mr5094365pfs.5.1459351253923;
        Wed, 30 Mar 2016 08:20:53 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.80.8 with SMTP id n8ls295808obx.52.gmail; Wed, 30 Mar 2016
 08:20:52 -0700 (PDT)
X-Received: by 10.157.61.137 with SMTP id l9mr4982425otc.36.1459351252577;
        Wed, 30 Mar 2016 08:20:52 -0700 (PDT)
Original-Received: from mail-ob0-x231.google.com (mail-ob0-x231.google.com. [2607:f8b0:4003:c01::231])
        by mx.google.com with ESMTPS id x40si3084769otx.232.2016.03.30.08.20.52
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 30 Mar 2016 08:20:52 -0700 (PDT)
Received-SPF: pass (google.com: domain of aendaerel@gmail.com designates 2607:f8b0:4003:c01::231 as permitted sender) client-ip=2607:f8b0:4003:c01::231;
Original-Received: by mail-ob0-x231.google.com with SMTP id m7so68022887obh.3
        for <std-proposals@isocpp.org>; Wed, 30 Mar 2016 08:20:52 -0700 (PDT)
X-Received: by 10.182.125.100 with SMTP id mp4mr1593569obb.24.1459351246296;
 Wed, 30 Mar 2016 08:20:46 -0700 (PDT)
Original-Received: by 10.202.75.198 with HTTP; Wed, 30 Mar 2016 08:20:46 -0700 (PDT)
In-Reply-To: <1fdbd2bc-9f4d-479c-b987-028ef4a32d15@isocpp.org>
X-Original-Sender: aendaerel@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 aendaerel@gmail.com designates 2607:f8b0:4003:c01::231 as permitted sender)
 smtp.mailfrom=aendaerel@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-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://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>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:25372
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/25372>

--089e013cb802a35f9c052f45b062
Content-Type: text/plain; charset=UTF-8

2016-03-30 14:04 GMT+05:00 <bruno.manga95@gmail.com>:

> Would that be allowed to work on constexpr function parameters?


I think it's not, because its purpose is to *request* a guarantee that
there will be no run-time.

constexpr int foo (int x)
{
     constexpr int j = constexpr (x);
     return bar(j);
}

In this case, it is impossible to guarantee that 'x' always will be
constexpr, and i don't think that this is the right way to specify
constexpr-only function.

-- 
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/CANaLnBrZFUKbUD_90-9O_OX7waZpa1N9YtA_pNOnux00H8qUCw%40mail.gmail.com.

--089e013cb802a35f9c052f45b062
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">=
2016-03-30 14:04 GMT+05:00  <span dir=3D"ltr">&lt;<a href=3D"mailto:bruno.m=
anga95@gmail.com" target=3D"_blank">bruno.manga95@gmail.com</a>&gt;</span>:=
<br><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bor=
der-left:1px solid rgb(204,204,204);padding-left:1ex">Would that be allowed=
 to work on constexpr function parameters?</blockquote></div><br></div><div=
 class=3D"gmail_extra">I think it&#39;s not, because its purpose is to <i>r=
equest</i> a guarantee that there will be no run-time.<br><br><div style=3D=
"margin-left:40px"><code><span style=3D"color:rgb(0,0,136)">constexpr</span=
><span style=3D"color:rgb(0,0,0)"> </span><span style=3D"color:rgb(0,0,136)=
">int</span><span style=3D"color:rgb(0,0,0)"> foo </span><span style=3D"col=
or:rgb(102,102,0)">(</span><span style=3D"color:rgb(0,0,136)">int</span><sp=
an style=3D"color:rgb(0,0,0)"> x</span><span style=3D"color:rgb(102,102,0)"=
>)</span><span style=3D"color:rgb(0,0,0)"></span></code><br><code><span sty=
le=3D"color:rgb(0,0,0)"></span><span style=3D"color:rgb(102,102,0)">{</span=
><span style=3D"color:rgb(0,0,0)"></span></code><br><code><span style=3D"co=
lor:rgb(0,0,0)">=C2=A0 =C2=A0 =C2=A0</span><span style=3D"color:rgb(0,0,136=
)">constexpr</span><span style=3D"color:rgb(0,0,0)"> </span><span style=3D"=
color:rgb(0,0,136)">int</span><span style=3D"color:rgb(0,0,0)"> j </span><s=
pan style=3D"color:rgb(102,102,0)">=3D</span><span style=3D"color:rgb(0,0,0=
)"> </span><span style=3D"color:rgb(0,0,136)">constexpr</span><span style=
=3D"color:rgb(0,0,0)"> </span><span style=3D"color:rgb(102,102,0)">(</span>=
<span style=3D"color:rgb(0,0,0)">x</span><span style=3D"color:rgb(102,102,0=
)">)</span><span style=3D"color:rgb(102,102,0)">;</span><span style=3D"colo=
r:rgb(0,0,0)"></span></code><br><code><span style=3D"color:rgb(0,0,0)">=C2=
=A0 =C2=A0 =C2=A0</span><span style=3D"color:rgb(0,0,136)">return</span><sp=
an style=3D"color:rgb(0,0,0)"> bar</span><span style=3D"color:rgb(102,102,0=
)">(</span><span style=3D"color:rgb(0,0,0)">j</span><span style=3D"color:rg=
b(102,102,0)">);</span><span style=3D"color:rgb(0,0,0)"></span></code><br><=
code><span style=3D"color:rgb(0,0,0)"></span><span style=3D"color:rgb(102,1=
02,0)">}</span><span style=3D"color:rgb(0,0,0)"></span></code><br></div><di=
v style=3D"margin-left:40px"><code><span style=3D"color:rgb(0,0,0)"></span>=
</code></div><br></div><div class=3D"gmail_extra">In this case, it is impos=
sible to guarantee that &#39;x&#39; always will be constexpr, and i don&#39=
;t think that this is the right way to specify constexpr-only function.<br>=
</div></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CANaLnBrZFUKbUD_90-9O_OX7waZpa1N9YtA_=
pNOnux00H8qUCw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CANaLnBrZFUKbUD_9=
0-9O_OX7waZpa1N9YtA_pNOnux00H8qUCw%40mail.gmail.com</a>.<br />

--089e013cb802a35f9c052f45b062--

.
