220 34240 <635c6793-0bb8-4407-b890-04ab33d1fe8b@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Bastien Penavayre <swac31@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: constexpr only functions: arbitrary literal types
 for non-type, constexpr arguments, is_constexpr...
Date: Thu, 31 Aug 2017 14:32:27 -0700 (PDT)
Lines: 118
Approved: news@gmane.org
Message-ID: <635c6793-0bb8-4407-b890-04ab33d1fe8b@isocpp.org>
References: <17e156a0-0368-4ec0-a087-e8b4bc8d9f62@isocpp.org>
 <CA+fGSbMtnehJhDx3Bz_GfxsqyrK_ch5hes7aGZqnufrimtG=gQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_949_1258920723.1504215147232"
X-Trace: blaine.gmane.org 1504215167 24619 195.159.176.226 (31 Aug 2017 21:32:47 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 31 Aug 2017 21:32:47 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCX2P6W5SEDBB24AULGQKGQEQFL6XEQ@isocpp.org Thu Aug 31 23:32:42 2017
Return-path: <std-proposals+bncBCX2P6W5SEDBB24AULGQKGQEQFL6XEQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-io0-f200.google.com ([209.85.223.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCX2P6W5SEDBB24AULGQKGQEQFL6XEQ@isocpp.org>)
	id 1dnX4Y-0005C7-5e
	for gclcip-std-proposals@m.gmane.org; Thu, 31 Aug 2017 23:32:22 +0200
Original-Received: by mail-io0-f200.google.com with SMTP id z67sf2634644iof.21
        for <gclcip-std-proposals@m.gmane.org>; Thu, 31 Aug 2017 14:32:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=eAer7CHptwEZsKQJcwP590RPwEJJ3pdIJBzyFFZhHcY=;
        b=MWzeJTl+hcdPKM9w7lTz9NXmjte8DeIXJ+r6wl17OKyX1UwajUqaI09kkSKIf1kG0e
         +jXQWJbQ03NuqomuU3ZAHmxikeeDHIM411pH2/MlVv9zWYr8LM6fQinx3qCN7e0vpnBs
         zkSi31XFQIZOk1EEHh1xe6lJo+R2gdKwB3OUhPXLbO+WaAD8SIRjmiP5c4MJJMpaKeo0
         4SlwoGE/2EsvNURgCfJalFK/q1JJVNUhaE8CUMRgbJ5vSXQlv/4Z0oDSIqN6LVuh1+7z
         Z/JMN7M9JRQGfMKNdE2Px3/RcS7HtH7P9q2NuBoD6pdMZRtFTmt1LgJUHyDwNqa12kwc
         vY3Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=eAer7CHptwEZsKQJcwP590RPwEJJ3pdIJBzyFFZhHcY=;
        b=Q1OIZP/yypGbaaPbxJdGjShxJDqDUXSIUCjkkutX07HnMm62g2wkVXwD40Y2gUq/hr
         sX5Q9pbIjkBkmq+C8c+MJa3ggm7KBI8w+gfTPrhmfE/eebCIGfxL3nFxtEPs1tsQ5mtc
         7RlmiaV3Q3Lw+Y+OQZXMCl6pKHLOGiPU641sWnpZdVH48q37c4kW1mtvRHvN2kymXu/+
         AK2QTnJDZz7Fe+w5fRvjH8nh+Od+A/iieWfcxlHHAS1jjI+ttzJpo7mDsTPwwaBFg8Kw
         DCV7d+sIWX5C342Yie+Imd4og1xhjAvZ/UFbhOe/IifxalFUiXwNp2e9QzJRicqT+xcZ
         Yvcg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=eAer7CHptwEZsKQJcwP590RPwEJJ3pdIJBzyFFZhHcY=;
        b=VctTKm7tD+duRYO6w41BjnR/G+/vh/PLRHEn4Oft3+HiQ82D43TVKeInJopf/hCCRd
         SY6wC3zi93fPO5mcAFk9HZ4LR1PayDv5PSo7Qanff9Rs/qZKk6lGVhwY07bRv2R9MvWn
         2VB4OaCcx2tKdHcgCY/N+/g7px1Sn9Kxq4ubZFIHAm5r/x2rULoruMsxYfnPCtdT+2PY
         363SdjPlUXvMRwdWbuvJlN+0qp3LnKHM30XLqJRi7H/74m3cNkku6tLpgExjcZQpPjCa
         IFkAzpxp+fYrf52mYYzHmanjMswBPYV25JOiH5d/fQgkgnX+0x3wjbpFAZ+xRjmpq69y
         xcFw==
X-Gm-Message-State: AHPjjUh9gq7NLMSROVaqswgUlpNgbHqqMby7UWa8RMTRm9v8Rk3If5Hj
	gL6jbf4zvQdpba75
X-Google-Smtp-Source: ADKCNb4YVJ/O9DYY680oHb7OEVvSr1XrOiZX86wLfOL9Cgq5IfraFXE3e3eF3nZI7B8f89gXHEcCCw==
X-Received: by 10.36.86.20 with SMTP id o20mr1294490itb.35.1504215148917;
        Thu, 31 Aug 2017 14:32:28 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.169.68 with SMTP id x4ls365351iti.0.gmail; Thu, 31 Aug 2017
 14:32:27 -0700 (PDT)
X-Received: by 10.31.146.11 with SMTP id u11mr56461vkd.22.1504215147689;
        Thu, 31 Aug 2017 14:32:27 -0700 (PDT)
In-Reply-To: <CA+fGSbMtnehJhDx3Bz_GfxsqyrK_ch5hes7aGZqnufrimtG=gQ@mail.gmail.com>
X-Original-Sender: swac31@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: <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:34240
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/34240>

------=_Part_949_1258920723.1504215147232
Content-Type: multipart/alternative; 
	boundary="----=_Part_950_1368746726.1504215147233"

------=_Part_950_1368746726.1504215147233
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Le jeudi 31 ao=C3=BBt 2017 22:17:41 UTC+2, Ricardo Andrade a =C3=A9crit :
>
> Very interesting proposal. Looking forward to hearing additional feedback=
=20
> from others, I hope it moves forward.
>
Thanks.

> Simple syntax question: why not placing constexpr() next to where=20
> noexcept() is, at the end of the function declaration/definition?
>
That's a good question. I'm not opposed to the idea but my motivation was=
=20
the following:

To make as little change as possible to the existing grammar.
As of now constexpr is a front specifier for function/members, tail=20
specifier for lambdas and syntactically I'm only expending it, i'm not=20
creating something new.
auto func() constexpr; //invalid now

 | This alternative seems more consistent, even with lambda functions=20
examples.
You can notice that it's the case with the lambdas in my exemple and I=20
agree,
but for now lambdas and functions/methods don't have the same syntax to=20
express their constexpr-ness.
A Proposal to correct this wouldn't be affected by this proposal.

On a more design oriented front, as constexpr would allow "specialization"=
=20
I feel like it's not a bad idea to put it at the front of the function, to=
=20
make it more visible.

I hope I've answered your question correctly.
If you have any other, please, feel free to ask.

--=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/635c6793-0bb8-4407-b890-04ab33d1fe8b%40isocpp.or=
g.

------=_Part_950_1368746726.1504215147233
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Le jeudi 31 ao=C3=BBt 2017 22:17:41 UTC+2, Ricardo Andrade=
 a =C3=A9crit=C2=A0:<blockquote class=3D"gmail_quote" style=3D"margin: 0;ma=
rgin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr">Very interesting proposal. Looking forward to hearing additional f=
eedback from others, I hope it moves forward.</div></blockquote><div>Thanks=
..</div><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"><div>S=
imple syntax question: why not placing constexpr() next to where noexcept()=
 is, at the end of the function declaration/definition?</div></div></blockq=
uote><div>That&#39;s a good question. I&#39;m not opposed to the idea but m=
y motivation was the following:</div><div><br></div><div>To make as little =
change as possible to the existing grammar.<br>As of now constexpr is a fro=
nt specifier for function/members, tail specifier for lambdas and syntactic=
ally I&#39;m only expending it, i&#39;m not creating something new.<br><div=
 class=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250); borde=
r-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; word-w=
rap: break-word;"><code class=3D"prettyprint"><div class=3D"subprettyprint"=
><span style=3D"color: #008;" class=3D"styled-by-prettify">auto</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"> func</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">()</span><span style=3D"col=
or: #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 style=3D"color: #000;" class=3D=
"styled-by-prettify"> </span><span style=3D"color: #800;" class=3D"styled-b=
y-prettify">//invalid now</span></div></code></div><span class=3D"styled-by=
-prettify" style=3D"background-color: rgb(250, 250, 250); color: rgb(136, 0=
, 0);"><br></span></div><div>=C2=A0| This alternative seems more consistent=
, even with lambda functions examples.</div><div>You can notice that it&#39=
;s the case with the lambdas in my exemple and I agree,</div><div>but for n=
ow lambdas and functions/methods don&#39;t have the same syntax to express =
their constexpr-ness.</div><div>A Proposal to correct this wouldn&#39;t be =
affected by this proposal.</div><div><br></div><div>On a more design orient=
ed front, as constexpr would allow &quot;specialization&quot; I feel like i=
t&#39;s not a bad idea to put it at the front of the function, to make it m=
ore visible.</div><div><br></div><div>I hope I&#39;ve answered your questio=
n correctly.</div><div>If you have any other, please, feel free to ask.</di=
v></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/635c6793-0bb8-4407-b890-04ab33d1fe8b%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/635c6793-0bb8-4407-b890-04ab33d1fe8b=
%40isocpp.org</a>.<br />

------=_Part_950_1368746726.1504215147233--

------=_Part_949_1258920723.1504215147232--

.
