220 39045 <f377a21c-926e-4cd8-9c25-5c36b7a7a62c@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: gmisocpp@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: constexpr! or constexpr(true)
Date: Mon, 9 Jul 2018 17:04:11 -0700 (PDT)
Lines: 126
Approved: news@gmane.org
Message-ID: <f377a21c-926e-4cd8-9c25-5c36b7a7a62c@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_13132_2031270130.1531181051089"
X-Trace: blaine.gmane.org 1531180925 31673 195.159.176.226 (10 Jul 2018 00:02:05 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 10 Jul 2018 00:02:05 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCM3TRNUXUDBB67PR7NAKGQE3VKCGWQ@isocpp.org Tue Jul 10 02:02:01 2018
Return-path: <std-proposals+bncBCM3TRNUXUDBB67PR7NAKGQE3VKCGWQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f197.google.com ([209.85.161.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCM3TRNUXUDBB67PR7NAKGQE3VKCGWQ@isocpp.org>)
	id 1fcg6T-00087s-5c
	for gclcip-std-proposals@m.gmane.org; Tue, 10 Jul 2018 02:02:01 +0200
Original-Received: by mail-yw0-f197.google.com with SMTP id u1-v6sf20973384ywg.6
        for <gclcip-std-proposals@m.gmane.org>; Mon, 09 Jul 2018 17:04:12 -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:subject:mime-version:x-original-sender
         :reply-to:precedence:mailing-list:list-id:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=V/FIy858czorgc4e8WW7L9kASs0BKu/5s5ghkMZAmno=;
        b=Z6nKjjPW/VMlA2/bGfI0SdHK1GvYPMCQgPk+kUqfwS7q4ckb504O48bN/RTLOMigFg
         5IqYerpYHtWHw2aX1aI49J5UhEyIeUng/8U7szuyUjilqilxxH/iMaJj3C+uJSy4Zmv5
         JbWZ2DpBpLyuN23+B1asGB5YIw5G54f45ZPwuZXbju3YnUQ4onIvu7uE0CdtSQ1jIuPz
         AWNk99y8w/2pEmq6U36el4mZheTU2qQJuCNMyp2vbJsvRRqiZ1n/X1O2x8qopVzY3Ze4
         ZJzwCSQ4m3cLr8SsMTEcT6b6Fa2O+f8NuEVWMN6ftzUXXA1ro97uX3RLCDZ4JixMprsI
         LnYQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:subject:mime-version:x-original-sender
         :reply-to:precedence:mailing-list:list-id:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=V/FIy858czorgc4e8WW7L9kASs0BKu/5s5ghkMZAmno=;
        b=YtsROFtb5uiHGnu5G5U3dTG22yS324ccXKfNCEb8xCuC2IyHqJd9Pc05aq2/DVLc80
         PvnF9Ga96G3Wg4JGGC3Hr/BGz4HwTdTf4ujJDlgETnP5nxAhPrIrEJp0PkQ4XeWtgM+C
         w4PXJin8qbusvhoBqi/nO0BistCBlrWeE0jKXcfFXiUz0mQFPjHd4+0ME8WD8C3LF8LH
         K7tfyvlKt64sktZpqjGZfdxOD42MIP0WgIlzcl2NgeZnzhovHR9lDE8N6QPWIwuRR/y0
         puObO5tYAFfvPfLG6cSx6K+NgXUSyIH65UTBxZ5gIymuToKD++7eIEKa48DtkFkFNLHj
         KoJw==
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: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=V/FIy858czorgc4e8WW7L9kASs0BKu/5s5ghkMZAmno=;
        b=kwlEHcArH1ICQ5MxmusXVVSaRg+02ZstHwGiNr8qq6tmVq2hxFsclteVejK5x+d2fX
         xkK+NMPLsI7pw7Gwd04/cv0jnIv16bgrpe34i31Kxf/g09RoF6Ah5Mx7KX9MvFRj+2Zw
         GhRxZvcjwghBAXSKpbtxMaljGjiAL1GCzd9i6dAOgfJhuPwto946CrFuYD+Hh/X276c8
         0apudDOALpqvYrwjTwAT+3KYd/YUcV2s4Qb7RsjPdxeFdJJtqLcd7cXRzLwvtNnRsO6b
         YtzUh1YHfy+WBVF8bxTFKbMTIjKEN1OXabkwwtJ+hz7TrxN/yB7XK2PAJcLed9cXYXsb
         XsxA==
X-Gm-Message-State: APt69E3bF7wouRLFM5FhewsivMS5ZHDdA0fO1ZxMiopslSeGl6naO+k0
	0MUy8vRpK4rm9gi2gnMs+61NDA==
X-Google-Smtp-Source: AAOMgper9DSHvlVd6JBHiwngi92btdx4BCeP9fTMWbTb2JxQ7iyKM/wblNmO4Vssi6sSubTk7JGQYg==
X-Received: by 2002:a81:7cd5:: with SMTP id x204-v6mr6898088ywc.94.1531181052192;
        Mon, 09 Jul 2018 17:04:12 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a25:3881:: with SMTP id f123-v6ls4319469yba.16.gmail; Mon,
 09 Jul 2018 17:04:11 -0700 (PDT)
X-Received: by 2002:a25:8486:: with SMTP id v6-v6mr3129502ybk.3.1531181051461;
        Mon, 09 Jul 2018 17:04:11 -0700 (PDT)
X-Original-Sender: gmisocpp@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:39045
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/39045>

------=_Part_13132_2031270130.1531181051089
Content-Type: multipart/alternative; 
	boundary="----=_Part_13133_540229585.1531181051089"

------=_Part_13133_540229585.1531181051089
Content-Type: text/plain; charset="UTF-8"

Hello everyone

Have the authors of p10731r.html considered if this suggestion:

constexpr(true) int sqr(int n) {
  return n*n;
}

is preferable and more consistent or flexible than this which they 
currently propose:

constexpr! int sqr(int n) {
  return n*n;
}

And would it offer the following possibility and would it be useful?:

constexpr(some_condition()) int sqr(int n) { // constexpr this function on 
certain conditions.
  return n*n;
}

Also many compilers support forceinline functionality etc. Perhaps this 
should be standardized too now?
Therefore I think the authors might want to propose this too:

inline(false) int sqr(int n) { // force inline. Or inline! if the committee 
thinks best.
  return n*n;
}

Which might similarly allow this?:
inline(some_other_condiition()) int sqr(int n) { // force inline. Or 
inline! if the committee thinks best.
  return n*n;
}

where some_other_condition might test for a certain platform or compile 
where forcing inline or not might be desirable despite what the compiler 
thinks.

It seems to me using ! is a little unusual syntax and be less consistent 
and flexible than what I'm proposing but I admit ! is shorter.

I see such macros regarding forceinline in various code bases such as 
libcxx's __config file. So perhaps forceinline's time has come too.

What do the authors of p1073r1 and others think?

Thanks
Show trimmed content 
Click here to Reply

-- 
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/f377a21c-926e-4cd8-9c25-5c36b7a7a62c%40isocpp.org.

------=_Part_13133_540229585.1531181051089
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div style=3D"max-height: 10000px;"><div dir=3D"ltr"><div>=
Hello everyone</div><div><br>Have the authors of=C2=A0p10731r.html consider=
ed if this suggestion:</div><div><br></div><p>constexpr(true) int sqr(int n=
) {<br>=C2=A0 return n*n;<br>}</p><div><br></div><div>is preferable and mor=
e consistent or flexible than this which=C2=A0they currently propose:</div>=
<div><br></div><div>constexpr! int sqr(int n) {<br>=C2=A0 return n*n;<br>}<=
/div><div><br></div><div>And would=C2=A0it offer=C2=A0the following=C2=A0po=
ssibility and would it be useful?:</div><div><br></div><div>constexpr(some_=
condition()) int sqr(int n) { //=C2=A0constexpr this function=C2=A0on certa=
in=C2=A0conditions.<br>=C2=A0 return n*n;<br>}</div><div><br>Also=C2=A0many=
 compilers support=C2=A0forceinline functionality etc. Perhaps this should =
be standardized too now?</div><div>Therefore I think the authors might want=
 to=C2=A0propose this too:</div><div><br></div><div>inline(false) int sqr(i=
nt n) { // force inline. Or inline! if the committee thinks best.<br>=C2=A0=
 return n*n;<br>}</div><div><br></div><div>Which might similarly allow this=
?:</div><div>inline(some_other_condiition()<wbr>) int sqr(int n) { // force=
 inline. Or inline! if the committee thinks best.<br>=C2=A0 return n*n;<br>=
}</div><div><br></div><div>where some_other_condition might=C2=A0test for a=
 certain platform or compile where forcing inline or not might be desirable=
 despite what the compiler thinks.</div><div><br></div><div>It seems to me =
using ! is a little unusual syntax=C2=A0and be less consistent and flexible=
 than what I&#39;m proposing but=C2=A0I admit ! is shorter.</div><div><div>=
<br></div><div>I see such macros regarding forceinline in various code base=
s such as libcxx&#39;s __config file. So perhaps forceinline&#39;s time has=
 come too.</div></div><div><br></div><div>What do the authors of=C2=A0p1073=
r1 and others think?</div><div><br></div><div>Thanks<br></div></div></div><=
a class=3D"gwt-Anchor" aria-hidden=3D"true" style=3D"display: none;">Show t=
rimmed content</a> <div class=3D"F0XO1GC-nb-P" style=3D"display: none;"><di=
v></div></div><div></div><div></div><div style=3D"display: none;"></div><di=
v style=3D"display: none;"></div><div><div class=3D"F0XO1GC-ed-a"></div></d=
iv><div class=3D"F0XO1GC-nb-b"><div class=3D"F0XO1GC-nb-a F0XO1GC-nb-cb"><d=
iv><div style=3D"display: inline-block;"><div style=3D"display: none;"></di=
v></div> <div class=3D"F0XO1GC-md-a"><div class=3D"F0XO1GC-md-b" id=3D"q_re=
ply">Click here to <span class=3D"F0XO1GC-md-c">Reply</span></div></div></d=
iv></div></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/f377a21c-926e-4cd8-9c25-5c36b7a7a62c%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/f377a21c-926e-4cd8-9c25-5c36b7a7a62c=
%40isocpp.org</a>.<br />

------=_Part_13133_540229585.1531181051089--

------=_Part_13132_2031270130.1531181051089--

.
