220 5143 <da135924-3e1e-40eb-a194-ebf82d568a3b@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Jonathan Wakely <cxx@kayari.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: constexpr data member
Date: Wed, 19 Jun 2013 16:30:52 -0700 (PDT)
Lines: 113
Approved: news@gmane.org
Message-ID: <da135924-3e1e-40eb-a194-ebf82d568a3b@isocpp.org>
References: <CAGsORuDonz16fG51JaLgDCHptjpZAnuWM2AgNrBN_44hxUqjXA@mail.gmail.com>
 <300a19dd-8a82-4788-9802-45170480b30a@isocpp.org>
 <CAGsORuBWr7F6wpyUd1mBFDKGU7P9jKaPaq+wOYDpFL6QGH7Byw@mail.gmail.com>
 <63d90b03-5605-476d-b40b-7ebcee0d3354@isocpp.org>
 <CAGsORuD58nw+76_2_pp6GqpwGKhbVHJ40wnCZccrUXRjxB_qNQ@mail.gmail.com>
 <cf218cdb-bfda-46e7-bedb-23795ace1ae3@isocpp.org>
 <CAGsORuAMLbeFJZwrjmaMV6AF7rop==h8BJiGiBAtgxQxO7E++g@mail.gmail.com>
 <0df105c5-7019-4674-83ac-1b071964210b@isocpp.org>
 <CAGsORuCmGnrUg+hkXCWssHp5KPu1wS+GsO__DwoDi13Y1UTDfA@mail.gmail.com>
 <9a4c139d-b08f-4dab-b5a3-9ff9d3139061@isocpp.org>
 <CAGsORuDsfTaLrJh_eL7Ke3jho9=EzMsKZ944tEnyrwrCko8APQ@mail.gmail.com>
 <1ef2b6fd-21f7-4492-a778-03952dd1720d@isocpp.org>
 <CAGsORuDE7=iC38rYdtqTgj3m5-jmtKWOK__hE7tj6o6M4a9aKA@mail.gmail.com>
 <CAGsORuCU_-sD9YYLO9W76O5UuEui8+vfH1Xj4n4MRuHDU7Ujmg@mail.gmail.com>
 <9a534f6b-4d07-4aa7-a164-4f713a3dd9ac@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_1310_9839097.1371684652063"
X-Trace: ger.gmane.org 1371684654 13001 80.91.229.3 (19 Jun 2013 23:30:54 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 19 Jun 2013 23:30:54 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCMONUNYS4IRBLH6RCHAKGQEWXGGS3I@isocpp.org Thu Jun 20 01:30:55 2013
Return-path: <std-proposals+bncBCMONUNYS4IRBLH6RCHAKGQEWXGGS3I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qa0-f69.google.com ([209.85.216.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCMONUNYS4IRBLH6RCHAKGQEWXGGS3I@isocpp.org>)
	id 1UpRq2-0000h0-4c
	for gclcip-std-proposals@m.gmane.org; Thu, 20 Jun 2013 01:30:54 +0200
Original-Received: by mail-qa0-f69.google.com with SMTP id hu16sf1617682qab.4
        for <gclcip-std-proposals@m.gmane.org>; Wed, 19 Jun 2013 16:30:53 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=x-beenthere:date:from:to:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-google-group-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=+V8+3l1KET5BhTbkk0UExa8B9HlC847lL5KafQHaw9g=;
        b=aGO8R9XPdFMncbKoVLbx3LXa9MrdRfdS0K5oQP6kIH4DlxvrS0rPmzzmOoszjdnDnt
         TQbdK8XK3aFpvRNjoR2k3WwUsVxzjcL0R8507xjU82qTFnI2YmmD1peTVqgrmScdITdX
         ygnXVasFL29uxnCt4+O6Q3TnwB3Sizi93dxd5fDaem2sIZrWzgE+6VVCgy8qJzLV3fJN
         wkr2OmOyJwK55/CKKua7LpQr2xluUvieMC70G+J8onSYDcyVRx+4bWLsnuEWbooGnkKM
         8gvkBJQcBcIQuLo43rl3POOA3YN2FDTYGJcTyXmclsJG9NFO9zklDQw+8SlDK86S4qYt
         rNKw==
X-Received: by 10.236.153.202 with SMTP id f50mr2721797yhk.48.1371684653265;
        Wed, 19 Jun 2013 16:30:53 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.60.231 with SMTP id k7ls477129qer.22.gmail; Wed, 19 Jun
 2013 16:30:52 -0700 (PDT)
X-Received: by 10.49.35.109 with SMTP id g13mr117702qej.1.1371684652432;
        Wed, 19 Jun 2013 16:30:52 -0700 (PDT)
In-Reply-To: <9a534f6b-4d07-4aa7-a164-4f713a3dd9ac@isocpp.org>
X-Original-Sender: cxx@kayari.org
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: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:5143
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/5143>

------=_Part_1310_9839097.1371684652063
Content-Type: text/plain; charset=ISO-8859-1



On Thursday, June 20, 2013 12:26:31 AM UTC+1, Jonathan Wakely wrote:
>
>
>
> On Thursday, June 20, 2013 12:00:51 AM UTC+1, Zhihao Yuan wrote:
>>
>> On Wed, Jun 19, 2013 at 6:31 PM, Zhihao Yuan <lic...@gmail.com> wrote: 
>> > Richard gives me a new thought: If we can use the per-object syntax 
>> > `object.name` to access it, then it's no longer a static data member 
>> > (but I want they are actually per-class). 
>>
>> Or, there is another option: constexpr data members are 
>> only accessible within the class scope (including the member 
>> function definition outside the syntactical area of the class 
>> definition).  Thus, they are per-class, implemented as static 
>> data member, but NOT accessible with the syntax 
>>
>>   Class::name 
>>
>> This should be what I initially want (namely, some constant 
>> definition within the class scope).  I have to use private + 
>> static + constexpr to achieve that.  But it LGTM if the 
>> Class::name syntax is completely disabled. 
>>
>>
> Now it seems like you're just trying to invent a use for your idea, and it 
> still doesn't strike me as something that improves the language.  Just use 
> a private static member.
>
> Why should they not be accessible as a qualified name? What purpose does 
> disabling that serve?  It makes the language even more inconsistent: now 
> you have a name which is private to a class scope but can't be qualified by 
> the class name ... why?
>
>
Anyway, if you think the idea has merit write a full proposal.  It's been 
fairly universally dismissed here, but if you write a paper explaining its 
benefits maybe you'll convince the committee.

-- 

--- 
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_1310_9839097.1371684652063
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><br>On Thursday, June 20, 2013 12:26:31 AM UTC+1, Jonathan Wakely wrote=
:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bo=
rder-left: 1px #ccc solid;padding-left: 1ex;"><br><br>On Thursday, June 20,=
 2013 12:00:51 AM UTC+1, Zhihao Yuan wrote:<blockquote class=3D"gmail_quote=
" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-le=
ft:1ex">On Wed, Jun 19, 2013 at 6:31 PM, Zhihao Yuan &lt;<a>lic...@gmail.co=
m</a>&gt; wrote:
<br>&gt; Richard gives me a new thought: If we can use the per-object synta=
x
<br>&gt; `<a href=3D"http://object.name" target=3D"_blank">object.name</a>`=
 to access it, then it's no longer a static data member
<br>&gt; (but I want they are actually per-class).
<br>
<br>Or, there is another option: constexpr data members are
<br>only accessible within the class scope (including the member
<br>function definition outside the syntactical area of the class
<br>definition). &nbsp;Thus, they are per-class, implemented as static
<br>data member, but NOT accessible with the syntax
<br>
<br>&nbsp; Class::name
<br>
<br>This should be what I initially want (namely, some constant
<br>definition within the class scope). &nbsp;I have to use private +
<br>static + constexpr to achieve that. &nbsp;But it LGTM if the
<br>Class::name syntax is completely disabled.
<br><br></blockquote><div><br></div><div>Now it seems like you're just tryi=
ng to invent a use for your idea, and it still doesn't strike me as somethi=
ng that improves the language. &nbsp;Just use a private static member.</div=
><div><br></div><div>Why should they not be accessible as a qualified name?=
 What purpose does disabling that serve? &nbsp;It makes the language even m=
ore inconsistent: now you have a name which is private to a class scope but=
 can't be qualified by the class name ... why?</div><div><br></div></blockq=
uote><div><br></div><div>Anyway, if you think the idea has merit write a fu=
ll proposal. &nbsp;It's been fairly universally dismissed here, but if you =
write a paper explaining its benefits maybe you'll convince the committee.<=
/div>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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 />
&nbsp;<br />
&nbsp;<br />

------=_Part_1310_9839097.1371684652063--

.
