220 14663 <b17237cf-69aa-4c1e-9c61-349227271ca9@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: corentin.schreiber@cea.fr
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: "const public:" and "const private:" to avoid to
 write "T Get() const" member functions
Date: Thu, 20 Nov 2014 15:15:54 -0800 (PST)
Lines: 95
Approved: news@gmane.org
Message-ID: <b17237cf-69aa-4c1e-9c61-349227271ca9@isocpp.org>
References: <a15820e4-3c90-400d-bf49-434467d728f6@isocpp.org>	<CAFk2RUb2pRCcfVi42dhQwaVA_8LHEuBzd2ksVnjhvbmmUdntiQ@mail.gmail.com>	<CAGsORuCgwLBJthMHtRqmqvn8_xV_3TqH6x_XL=SFxppFFb+r_A@mail.gmail.com> <CAOfiQqnau89HHwe3euHkgKrewYemY8r4SG6axCtGEwLOkXbw7A@mail.gmail.com>
 <m4lrhn$r6l$1@ger.gmane.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_7016_825991797.1416525354766"
X-Trace: ger.gmane.org 1416525363 30733 80.91.229.3 (20 Nov 2014 23:16:03 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 20 Nov 2014 23:16:03 +0000 (UTC)
Cc: mw_triad@users.sourceforge.net
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCX4RQEPQAMBBK7MXGRQKGQE4FDHQZY@isocpp.org Fri Nov 21 00:15:57 2014
Return-path: <std-proposals+bncBCX4RQEPQAMBBK7MXGRQKGQE4FDHQZY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qc0-f200.google.com ([209.85.216.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCX4RQEPQAMBBK7MXGRQKGQE4FDHQZY@isocpp.org>)
	id 1XraxA-0002z4-2W
	for gclcip-std-proposals@m.gmane.org; Fri, 21 Nov 2014 00:15:56 +0100
Original-Received: by mail-qc0-f200.google.com with SMTP id r5sf7806175qcx.7
        for <gclcip-std-proposals@m.gmane.org>; Thu, 20 Nov 2014 15:15:55 -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:cc:message-id:in-reply-to
         :references:subject:mime-version:content-type:x-original-sender
         :reply-to:precedence:mailing-list:list-id:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=tCYOaucZZpTPkmbSwdzq2EQR3qJFWKBUwEIrD2Pf43U=;
        b=O0w6VsilkH6p88K+FvRxPugTYeKszLYs3zM2hCG/9NERAIsEKntLvJelhAjMMAaVfl
         YKDCfone4wTC7okuMFjx+h8Ps7pINFHIZZiDpgs/TVfJhQpci3dtWGWEqNE6a3fnrp7+
         1g9xBWBF9mlNAyp0MQIwBHPSC5rWymxep71xQ50hZZXbv9XyC95ZW+iX7s1EcZ5E0wtj
         eexFn6XBDjNGFX2FeLcOrcTOSsHE9mdBJc3wEdmWeuoj0M9nFENjkuwCO3qyZqoFfmg2
         bqy3O9UANHKtBpGPt/YZ5frVcGwM+svstwcr3OkiybJyihTUdGiF3LY9DpVsF6xlPQn8
         2TVw==
X-Gm-Message-State: ALoCoQkls8pFUJkr8tRhBXd8vg3puv5bNGg7ESB2lBa0oTVxlHv4PoNK24Vm4P0TsRW9efhFEItc
X-Received: by 10.224.172.132 with SMTP id l4mr1086538qaz.9.1416525355542;
        Thu, 20 Nov 2014 15:15:55 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.16.45 with SMTP id 42ls498212qga.62.gmail; Thu, 20 Nov
 2014 15:15:55 -0800 (PST)
X-Received: by 10.140.93.199 with SMTP id d65mr13607qge.20.1416525355137;
        Thu, 20 Nov 2014 15:15:55 -0800 (PST)
In-Reply-To: <m4lrhn$r6l$1@ger.gmane.org>
X-Original-Sender: corentin.schreiber@cea.fr
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: <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:14663
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/14663>

------=_Part_7016_825991797.1416525354766
Content-Type: multipart/alternative; 
	boundary="----=_Part_7017_1109837971.1416525354766"

------=_Part_7017_1109837971.1416525354766
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Le jeudi 20 novembre 2014 23:56:12 UTC+1, Matthew Woehlke a =C3=A9crit :
>
> On 2014-11-20 17:36, Richard Smith wrote:=20
> > A variant of the 'inline variables and encapsulated expressions'=20
> proposal=20
> > would allow this:=20
> >=20
> > class X {=20
> >   int private_x;=20
> > public:=20
> >   using public_x =3D +private_x;=20
> > };=20
> > X x;=20
> > int a =3D x.public_x; // ok, means the same thing as 'int a =3D=20
> +x.private_x;'=20
> > but access check is done inside X.=20
>
> How would you achieve this for a member of, say, a container type? (In=20
> my specific case, I have something like std::vector<Bar>...)=20
>
> --=20
> Matthew=20
>
>
using public_x =3D static_cast<const decltype(x)&>(private_x); ?=20

--=20

---=20
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 e=
mail 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-proposa=
ls/.

------=_Part_7017_1109837971.1416525354766
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Le jeudi 20 novembre 2014 23:56:12 UTC+1, Matthew Woehlke =
a =C3=A9crit&nbsp;:<blockquote class=3D"gmail_quote" style=3D"margin: 0;mar=
gin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 2014-11-=
20 17:36, Richard Smith wrote:
<br>&gt; A variant of the 'inline variables and encapsulated expressions' p=
roposal
<br>&gt; would allow this:
<br>&gt;=20
<br>&gt; class X {
<br>&gt; &nbsp; int private_x;
<br>&gt; public:
<br>&gt; &nbsp; using public_x =3D +private_x;
<br>&gt; };
<br>&gt; X x;
<br>&gt; int a =3D x.public_x; // ok, means the same thing as 'int a =3D +x=
..private_x;'
<br>&gt; but access check is done inside X.
<br>
<br>How would you achieve this for a member of, say, a container type? (In
<br>my specific case, I have something like std::vector&lt;Bar&gt;...)
<br>
<br>--=20
<br>Matthew
<br>
<br></blockquote><div><br>using public_x =3D static_cast&lt;const decltype(=
x)&amp;&gt;(private_x); ? <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_7017_1109837971.1416525354766--
------=_Part_7016_825991797.1416525354766--

.
