220 22204 <b75bf62e-cad0-4e8a-b086-40bd717b1ec7@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Columbo <r.hl@gmx.net>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Local constexpr variables and static storage duration
Date: Mon, 2 Nov 2015 14:04:51 -0800 (PST)
Lines: 67
Approved: news@gmane.org
Message-ID: <b75bf62e-cad0-4e8a-b086-40bd717b1ec7@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_4388_1085223667.1446501891823"
X-Trace: ger.gmane.org 1446501900 8010 80.91.229.3 (2 Nov 2015 22:05:00 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 2 Nov 2015 22:05:00 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDRN5RPSR4MRBBF436YQKGQEBI5JFLA@isocpp.org Mon Nov 02 23:04:56 2015
Return-path: <std-proposals+bncBDRN5RPSR4MRBBF436YQKGQEBI5JFLA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pa0-f72.google.com ([209.85.220.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDRN5RPSR4MRBBF436YQKGQEBI5JFLA@isocpp.org>)
	id 1ZtNDi-00027Q-Ta
	for gclcip-std-proposals@m.gmane.org; Mon, 02 Nov 2015 23:04:55 +0100
Original-Received: by pabyw1 with SMTP id yw1sf173387774pab.2
        for <gclcip-std-proposals@m.gmane.org>; Mon, 02 Nov 2015 14:04:53 -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:subject:mime-version
         :content-type: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=MhCEnNGfPjbg/eoTi6oKHqtKHRFkj81QiGNfs2w1ZVg=;
        b=YGaYuEvjetXf51lomMN4tFte0IyNdN04e6NXYkhS1aTKISElmYLuV0mSxtySMlU1eG
         YEQLwKub56dDLmAS7RI3ItBbC+FCh4rvsa0gIUVg1rHCPI3dYmG7hc+sH1bGhFrmZUEs
         m/iOsDQwWaOk7te6kjW7+H03VMQFhb+5hFsoAqA3tPqpg+4uDwWSX2t5UWM1VZ788DQm
         OpvikSoaf7qV1dAHNyw1JywFJw0Hd+eFiulwXMyxn8HCCrSwxhHvcrqyBypmv8nPS/JZ
         dILiwwwC6lBFKmTFrhG8hxpguCCEGwnjWnjdQMyUZh2I7ADG+3/eQfSAzLoaXwzEoYG+
         1Vfg==
X-Gm-Message-State: ALoCoQm6uNAclkiC5sX4+10YhkpjnBfEJhWzvnJczpbOwwIohZ1QJc2lB+ILIQ+1kwYnvPfNexXi
X-Received: by 10.66.182.135 with SMTP id ee7mr21458227pac.32.1446501893285;
        Mon, 02 Nov 2015 14:04:53 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.10.226 with SMTP id 95ls1475882iok.1.gmail; Mon, 02 Nov
 2015 14:04:52 -0800 (PST)
X-Received: by 10.50.164.165 with SMTP id yr5mr227146igb.7.1446501892428;
        Mon, 02 Nov 2015 14:04:52 -0800 (PST)
X-Original-Sender: R.HL@gmx.net
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: <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:22204
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/22204>

------=_Part_4388_1085223667.1446501891823
Content-Type: multipart/alternative; 
	boundary="----=_Part_4389_1147885575.1446501891824"

------=_Part_4389_1147885575.1446501891824
Content-Type: text/plain; charset=UTF-8

Is it possible to let local variables declared with constexpr have static storage 
duration? Since every constexpr variables's initializer can neither depend 
upon parameter values nor dynamically initialized (or modifiable) global 
state, they may as well have static storage duration with static 
initialization AFAICS.  Would that introduce any problems or have 
significant impacts? Note that it would allow reasonable things that are 
currently disallowed, e.g.
void f() {
    constexpr int arr[] {1, 2, 3}; 
    constexpr auto p = arr;
}

-- 

--- 
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_4389_1147885575.1446501891824
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Is it possible to let local variables declared with=C2=A0<=
font face=3D"courier new, monospace">constexpr</font>=C2=A0have=C2=A0<font =
face=3D"courier new, monospace">static</font>=C2=A0storage duration? Since =
every=C2=A0<font face=3D"courier new, monospace">constexpr</font>=C2=A0vari=
ables&#39;s initializer can neither depend upon parameter values nor dynami=
cally initialized (or modifiable) global state, they may as well have stati=
c storage duration with static initialization AFAICS. =C2=A0Would that intr=
oduce any problems or have significant impacts? Note that it would allow re=
asonable things that are currently disallowed, e.g.<div class=3D"prettyprin=
t" style=3D"border: 1px solid rgb(187, 187, 187); word-wrap: break-word; ba=
ckground-color: rgb(250, 250, 250);"><code class=3D"prettyprint"><div class=
=3D"subprettyprint"><font color=3D"#000088"><div class=3D"subprettyprint">v=
oid f() {</div><div class=3D"subprettyprint">=C2=A0 =C2=A0 constexpr int ar=
r[] {1, 2, 3};=C2=A0</div><div class=3D"subprettyprint">=C2=A0 =C2=A0 const=
expr auto p =3D arr;</div><div class=3D"subprettyprint">}</div></font></div=
></code></div><div><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_4389_1147885575.1446501891824--
------=_Part_4388_1085223667.1446501891823--

.
