220 26545 <12871812.eFz8c1onGI@tjmaciei-mobl1> article
Path: news.gmane.org!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Adding a const qualifier to class access modifiers
Date: Mon, 04 Jul 2016 13:16:59 -0700
Lines: 36
Approved: news@gmane.org
Message-ID: <12871812.eFz8c1onGI@tjmaciei-mobl1>
References: <7145a8aa-6a74-4ff3-8984-4a74aef66b5d@isocpp.org> <20160704042756.GA19918@noemi> <CAFk2RUaAW+xPzW5ov85qD0m9Dv6nikHZd0asUG7=2rinv3navg@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: ger.gmane.org 1467663430 12174 80.91.229.3 (4 Jul 2016 20:17:10 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 4 Jul 2016 20:17:10 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBPUI5O5QKGQE7PC6UNI@isocpp.org Mon Jul 04 22:17:03 2016
Return-path: <std-proposals+bncBCB4TK757YBRBPUI5O5QKGQE7PC6UNI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f69.google.com ([209.85.215.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCB4TK757YBRBPUI5O5QKGQE7PC6UNI@isocpp.org>)
	id 1bKAIh-0002NR-61
	for gclcip-std-proposals@m.gmane.org; Mon, 04 Jul 2016 22:17:03 +0200
Original-Received: by mail-lf0-f69.google.com with SMTP id a4sf127237915lfa.1
        for <gclcip-std-proposals@m.gmane.org>; Mon, 04 Jul 2016 13:17:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=from:to:subject:date:message-id:user-agent:in-reply-to:references
         :mime-version:x-original-sender:x-original-authentication-results
         :reply-to:precedence:mailing-list:list-id:x-spam-checked-in-group
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=HlL3OwRLpdUSyQAM68l+JTkga627KCByzglDEaf9cEc=;
        b=grnVEX08lhJGPzMD0kMdsDm0bbxZUCTBAP1P9SJZKvRq1itDXLE8JWMdFqiq7IVUMc
         sYQcjIJbNfs/exYnrf0zJZVeaVB27mgl47WndLOJeXkSRQysmmQ8vMGO0wc2gz3/HNGI
         KzJ64FIDl3h0D/Kn4JosE8NYOl87XMOuiA5OUzE+NIzsYHbJk0B/VT/WPl8aQMPNSapE
         VtVP+zEJYu26h5WZr/bSvm0V6IL/vCbXZ5JJbWV9b2eiGcM0QVYfoJlc3E5RR6oyZdXI
         orur9dwADg9Es/yjFdbMIdlSZ85bHob8ydX3xECp4w3xyd610xtnuKnzAxiJf2x1entY
         +zJw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:to:subject:date:message-id:user-agent
         :in-reply-to:references:mime-version:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=HlL3OwRLpdUSyQAM68l+JTkga627KCByzglDEaf9cEc=;
        b=NXkln3YmTnwiCxIU4dLk7/nbxxYVWPsj6CFtJngOG6uYe3p1YAntQJ6+41LCVt6R8F
         tbGOkcRCuMzf9XTw4C4A+GxLtBtKMTX5XdBKJDYxrnC/IIdf1/e5Oc509imD1EDemWgs
         qjz89L2FaMpGF8dCaoCdCBfQKtY2gZ69Wgvdn/O6YySOwALDjWxVsVeXtpEm+Kkjp+uG
         zGMDlEvtQyO/dFjti8qlu8FoQrEqLg0NKyggyXTw1cgMhDet7RWqQpghkyrbgyjSieSq
         PyEXbbFd2D0medhYgGPXrSBQYfctvLx9t5euLxYQNTaKLeSYYOTbPYwMq6WJxTpZLsIV
         BWCA==
X-Gm-Message-State: ALyK8tKKA0QU8tq82MQuVHd2MeKJgUAygedj87s3E/f69VN9SxkfuUpPfWM7wV9n/dMN1A==
X-Received: by 10.28.27.216 with SMTP id b207mr2102637wmb.6.1467663422600;
        Mon, 04 Jul 2016 13:17:02 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.210.6 with SMTP id j6ls452960wmg.27.canary; Mon, 04 Jul
 2016 13:17:01 -0700 (PDT)
X-Received: by 10.194.109.232 with SMTP id hv8mr12277304wjb.115.1467663421621;
        Mon, 04 Jul 2016 13:17:01 -0700 (PDT)
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [2a01:4f8:d13:f81:21c:14ff:fe01:12a3])
        by mx.google.com with ESMTP id y184si442008wmy.117.2016.07.04.13.17.01
        for <std-proposals@isocpp.org>;
        Mon, 04 Jul 2016 13:17:01 -0700 (PDT)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3 as permitted sender) client-ip=2a01:4f8:d13:f81:21c:14ff:fe01:12a3;
Original-Received: from tjmaciei-mobl1.localnet (unknown [IPv6:2601:1c0:5803:81c9:e172:ebef:a71a:a355])
	by gondolin.macieira.info (Postfix) with ESMTPSA id 4098711A78B
	for <std-proposals@isocpp.org>; Mon,  4 Jul 2016 13:17:01 -0700 (PDT)
User-Agent: KMail/5.2.2 (Linux/4.6.2-1-default; KDE/5.23.0; x86_64; ; )
In-Reply-To: <CAFk2RUaAW+xPzW5ov85qD0m9Dv6nikHZd0asUG7=2rinv3navg@mail.gmail.com>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3
 as permitted sender) smtp.mailfrom=thiago@macieira.org
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:26545
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/26545>

On segunda-feira, 4 de julho de 2016 12:52:41 PDT Ville Voutilainen wrote:
> With NDSMIs, this is what I'd do:
> 
> class X
> {
>     string data;
> public:
>     const string& cdata = data;
> };
> 
> I don't think the suggested problem is so common that we need to
> invent a new kind of an access specifier
> to cater for it.

What is the size of class X? Is it the same as class Y

class Y
{
	string data;
public:
	string cdata() const { return data; }
};

If it isn't guaranteed to be so by the standard in all implementations, then I 
can't use your syntax to replace Y with X.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center

-- 
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/12871812.eFz8c1onGI%40tjmaciei-mobl1.

.
