220 5127 <CAGsORuCmGnrUg+hkXCWssHp5KPu1wS+GsO__DwoDi13Y1UTDfA@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Zhihao Yuan <lichray@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: constexpr data member
Date: Wed, 19 Jun 2013 16:48:50 -0400
Lines: 47
Approved: news@gmane.org
Message-ID: <CAGsORuCmGnrUg+hkXCWssHp5KPu1wS+GsO__DwoDi13Y1UTDfA@mail.gmail.com>
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>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: ger.gmane.org 1371674935 22286 80.91.229.3 (19 Jun 2013 20:48:55 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 19 Jun 2013 20:48:55 +0000 (UTC)
To: "std-proposals@isocpp.org" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCUILMGRQMARBM5SRCHAKGQEQSWJ5VI@isocpp.org Wed Jun 19 22:48:57 2013
Return-path: <std-proposals+bncBCUILMGRQMARBM5SRCHAKGQEQSWJ5VI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ea0-f200.google.com ([209.85.215.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCUILMGRQMARBM5SRCHAKGQEQSWJ5VI@isocpp.org>)
	id 1UpPJE-0002qy-2I
	for gclcip-std-proposals@m.gmane.org; Wed, 19 Jun 2013 22:48:52 +0200
Original-Received: by mail-ea0-f200.google.com with SMTP id g15sf5309697eak.11
        for <gclcip-std-proposals@m.gmane.org>; Wed, 19 Jun 2013 13:48:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-beenthere:mime-version:in-reply-to:references:date:message-id
         :subject:from:to:x-original-sender:x-original-authentication-results
         :reply-to:precedence:mailing-list:list-id:x-google-group-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=HGX/+Z86oJP/Zpt/W/jLLd+qKTSv2bnFuR3BUGG645I=;
        b=vyUxxfT8E6nTUzurEV3Mi9Gkx7xfuoVgsi5oVcdL8PMNfzecqYgM7/52FJdMttd0Tn
         WiX84+nTPeoleIPEbDoy0HGbmnlic3cn1+HI8gIEAIyogdc6kBmmHgutUPGhBBtDb2Pm
         bpPXGLGq54SJ8fR7tfXpGJNZIVsTzxFDlVTw6nXKZ8PCnTCE5zU3qqKqrOuFGocJLcgl
         fqX1Apa9so8fsC/l2hW6HzWBP+FxaEn3RiLpQPzYlIrrHUsjb7u55pQGgEL9Bv7JPKBL
         aMHsTvBYiIGeguE1Dww4z3q/h7jvyATlSpXTUsKS/tNeuIUEWPkPAWgZFhT6u26D5jtn
         qzBg==
X-Received: by 10.112.145.40 with SMTP id sr8mr2090256lbb.22.1371674931534;
        Wed, 19 Jun 2013 13:48:51 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.4.161 with SMTP id l1ls34120lal.20.gmail; Wed, 19 Jun 2013
 13:48:50 -0700 (PDT)
X-Received: by 10.112.201.10 with SMTP id jw10mr4057882lbc.58.1371674930681;
        Wed, 19 Jun 2013 13:48:50 -0700 (PDT)
Original-Received: from mail-la0-x229.google.com (mail-la0-x229.google.com [2a00:1450:4010:c03::229])
        by mx.google.com with ESMTPS id p6si10720710lag.81.2013.06.19.13.48.50
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 19 Jun 2013 13:48:50 -0700 (PDT)
Received-SPF: pass (google.com: domain of lichray@gmail.com designates 2a00:1450:4010:c03::229 as permitted sender) client-ip=2a00:1450:4010:c03::229;
Original-Received: by mail-la0-f41.google.com with SMTP id fn20so5036028lab.14
        for <std-proposals@isocpp.org>; Wed, 19 Jun 2013 13:48:50 -0700 (PDT)
X-Received: by 10.112.205.163 with SMTP id lh3mr4117209lbc.45.1371674930504;
 Wed, 19 Jun 2013 13:48:50 -0700 (PDT)
Original-Received: by 10.112.79.161 with HTTP; Wed, 19 Jun 2013 13:48:50 -0700 (PDT)
In-Reply-To: <0df105c5-7019-4674-83ac-1b071964210b@isocpp.org>
X-Original-Sender: lichray@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of lichray@gmail.com designates 2a00:1450:4010:c03::229 as permitted
 sender) smtp.mail=lichray@gmail.com;       dkim=pass header.i=@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: <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:5127
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/5127>

On Wed, Jun 19, 2013 at 3:19 PM, Jonathan Wakely <cxx@kayari.org> wrote:
>> But a variable defined in namespace scope default to have external
>> linkage, then why a `const` qualifier can change its linkage?
>
> So that simple named constants in separate translation units don't interfere
> and you don't have to be careful about avoiding name clashes.

So that simple named constants in class scope are not duplicated
for each object (not allowed, forever) and you don't have to care
about what the constants actually are.

> OK, but what about the consistency of constexpr data members and consexpr
> member functions?

Re-read your comment, consistency of a data member and a
member function -- for what?  They don't have to be!  Just
like the `const` qualifier on a data member and a member function,
why asking for consistency on two different things?  You happen
to see that the effects of `static` which works on a data member
and a member function are similar, and you call it "consistency",
but at least I don't think it has to apply to constexpr.

>> Yes!  So that we can teach "constexpr variables are just constant,
>> don't spent your time on figuring out *what* exactly they are".
>
> I don't think your proposal helps that.

Well, for example, so that in any place, you can just define
variables with `constexpr` without any storage specifier and
it just works like a constant.

--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/

-- 

--- 
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/.



.
