220 15251 <89bab42c-78a8-4949-b362-57749eb6e366@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: sasho648 <sasho648@mail.bg>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Some constexpr changes.
Date: Tue, 23 Dec 2014 13:47:04 -0800 (PST)
Lines: 115
Approved: news@gmane.org
Message-ID: <89bab42c-78a8-4949-b362-57749eb6e366@isocpp.org>
References: <b849d2db-4d2b-4cb4-b31f-436a4f807efd@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_713_1544699603.1419371224125"
X-Trace: ger.gmane.org 1419371234 32657 80.91.229.3 (23 Dec 2014 21:47:14 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 23 Dec 2014 21:47:14 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDBNZXHN2QPRBWGF46SAKGQEKR73TCI@isocpp.org Tue Dec 23 22:47:06 2014
Return-path: <std-proposals+bncBDBNZXHN2QPRBWGF46SAKGQEKR73TCI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ob0-f197.google.com ([209.85.214.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDBNZXHN2QPRBWGF46SAKGQEKR73TCI@isocpp.org>)
	id 1Y3XIH-0003Ru-Nr
	for gclcip-std-proposals@m.gmane.org; Tue, 23 Dec 2014 22:47:05 +0100
Original-Received: by mail-ob0-f197.google.com with SMTP id va2sf189489650obc.0
        for <gclcip-std-proposals@m.gmane.org>; Tue, 23 Dec 2014 13:47:05 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:content-type:x-original-sender:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=Cma0gkVAdbknK+w3fifOHKtpspS1WZqYPwvN7MvEN20=;
        b=DXSCmZ/zqLSpYRGdGBQEST3qGNNKCVYXLY16plS7hc1uIc1gD18qvMf0xAXh25OkVC
         /cM974Bbloir1P9xgwcBvvxoJ5UV1qmi7pNKwkPfEsFevO4Z5n0kW3gZOJzRfPcfLMsU
         0tzHJKRSNF2rFaoIHY/GL4PoQDieswhx05lnwNlfyyN6WG+0k7UCjvmz5BkU/mUDW6uB
         vwd+oTEfX2lR+Fi3NY/IxkJw3YB6FoGxTJbK+PvH4kpiiOXSROIRRd8Ij7Yh5jbr3Pm+
         1WwlDUQND+0Lnd1A5LHUz5raxuv6bxC8J37Ik/KGOqO/mF3mPYX/Y5omnIv8YNzi5fu3
         QepQ==
X-Gm-Message-State: ALoCoQnovTJtjhK52ysYwaIAU++5rXNmOO/VD4EOV2M7AJIYEWip5C48oXErzIJ/SLbH5WN/Xdmz
X-Received: by 10.182.27.1 with SMTP id p1mr25400495obg.44.1419371224951;
        Tue, 23 Dec 2014 13:47:04 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.84.244 with SMTP id l107ls6164046qgd.47.gmail; Tue, 23 Dec
 2014 13:47:04 -0800 (PST)
X-Received: by 10.140.107.119 with SMTP id g110mr27476qgf.32.1419371224390;
        Tue, 23 Dec 2014 13:47:04 -0800 (PST)
In-Reply-To: <b849d2db-4d2b-4cb4-b31f-436a4f807efd@isocpp.org>
X-Original-Sender: sasho648@mail.bg
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:15251
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/15251>

------=_Part_713_1544699603.1419371224125
Content-Type: multipart/alternative; 
	boundary="----=_Part_714_836419038.1419371224125"

------=_Part_714_836419038.1419371224125
Content-Type: text/plain; charset=UTF-8

I thought that it'll be clearer, 'constexpr' function specifier, to be 
written after the function declaration. Also as a keyword that will 
restrict code-generation in an constant-expression function, I thought that 
keyword 'true' before 'constexpr' will be more meaningful then 'explicit'. 
So here are some examples using this new syntax:

constexpr int FuncAdd(int a, int b); // 'FuncAdd' have a return-type of 
'constexpr int'

int FuncAdd(int a, int b) constexpr; // 'FuncAdd' function is 'constexpr'

int FuncAdd(int a, int b) true constexpr; // 'FuncAdd' function is 'true 
constexpr' and so it isn't allowed to generate run-time code


What would you say - is this way better?

-- 

--- 
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_714_836419038.1419371224125
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I thought that it'll be clearer, 'constexpr' function spec=
ifier, to be written after the function declaration. Also as a keyword that=
 will restrict code-generation in an constant-expression function, I though=
t that keyword 'true' before 'constexpr' will be more meaningful then 'expl=
icit'. So here are some examples using this new syntax:<br><br><div class=
=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187, 187); word-wrap: =
break-word; background-color: rgb(250, 250, 250);"><code class=3D"prettypri=
nt"><div class=3D"subprettyprint"><span style=3D"color: #008;" class=3D"sty=
led-by-prettify">constexpr</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-pre=
ttify">int</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
 </span><span style=3D"color: #606;" class=3D"styled-by-prettify">FuncAdd</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">int</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> a</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D=
"styled-by-prettify">int</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> b</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">);</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> <=
/span><span style=3D"color: #800;" class=3D"styled-by-prettify">// 'FuncAdd=
' have a return-type of 'constexpr int'</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"><br><br></span><span style=3D"color: #008;" cl=
ass=3D"styled-by-prettify">int</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> </span><span style=3D"color: #606;" class=3D"styled-by=
-prettify">FuncAdd</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">(</span><span style=3D"color: #008;" class=3D"styled-by-prettify">i=
nt</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> a</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">int</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> b</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: #008;" class=3D"styled-by-pr=
ettify">constexpr</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> <=
/span><span style=3D"color: #800;" class=3D"styled-by-prettify">// 'FuncAdd=
' function is 'constexpr'</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"><br><br></span><span style=3D"color: #008;" class=3D"styled-=
by-prettify">int</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> </span><span style=3D"color: #606;" class=3D"styled-by-prettify">Fun=
cAdd</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</spa=
n><span style=3D"color: #008;" class=3D"styled-by-prettify">int</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"> a</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" =
class=3D"styled-by-prettify">int</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> b</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">)</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">tr=
ue</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span>=
<span style=3D"color: #008;" class=3D"styled-by-prettify">constexpr</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"colo=
r: #800;" class=3D"styled-by-prettify">// 'FuncAdd' function is 'true const=
expr' and so it isn't allowed to generate run-time code</span></div></code>=
</div><div><br><span class=3D"styled-by-prettify" style=3D"font-family: mon=
ospace; color: rgb(136, 0, 0); background-color: rgb(250, 250, 250);"><br><=
/span>What would you say - is this way better?<br></div></div>

<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 />

------=_Part_714_836419038.1419371224125--
------=_Part_713_1544699603.1419371224125--

.
