220 16064 <CAGMoNKtjXtq57fxF2sxrsPXLx7Po-xfXLQQRMAhE8EeU-2+CvQ@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: mobi phil <mobi@mobiphil.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: const T* operator->() const
Date: Fri, 6 Feb 2015 10:50:43 +0100
Lines: 94
Approved: news@gmane.org
Message-ID: <CAGMoNKtjXtq57fxF2sxrsPXLx7Po-xfXLQQRMAhE8EeU-2+CvQ@mail.gmail.com>
References: <56a7727d-9839-45c9-be72-a6ecb61f38c9@isocpp.org>
	<2900481.dbBOWPyqhq@tjmaciei-mobl4>
	<CAGMoNKveu2TKCFZnqAypP-bqZMzWfCPjOBb6AnUDbx776Tvu3g@mail.gmail.com>
	<1932997.CYfMEhPeyI@tjmaciei-mobl4>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a113f8f8aa001f4050e685ae0
X-Trace: ger.gmane.org 1423216255 18128 80.91.229.3 (6 Feb 2015 09:50:55 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 6 Feb 2015 09:50:55 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDF3H34L74HRB4442KTAKGQEW2SVXNQ@isocpp.org Fri Feb 06 10:50:45 2015
Return-path: <std-proposals+bncBDF3H34L74HRB4442KTAKGQEW2SVXNQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-oi0-f71.google.com ([209.85.218.71])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDF3H34L74HRB4442KTAKGQEW2SVXNQ@isocpp.org>)
	id 1YJfYj-0003PC-Mx
	for gclcip-std-proposals@m.gmane.org; Fri, 06 Feb 2015 10:50:45 +0100
Original-Received: by mail-oi0-f71.google.com with SMTP id x69sf2438768oia.2
        for <gclcip-std-proposals@m.gmane.org>; Fri, 06 Feb 2015 01:50:44 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:content-type:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=iiyh27xdQANXbg2ntjL4Bfd+wF4DQmT9zYJB6FK7PwA=;
        b=dZ+d0NLL/nJlOQOqRRlQHdQ0W6PyBOJpXLvAPswX5IHBvLvBH2SIE+ZnT9XQtlB0iE
         LH9kY7e+wITkiwbfxxfrCxtF6LTmJp+qUfPl/Bbi8MTXd5ISULU6FeRtHY6RBEoFn6Pn
         8ysmaAfD/ihgR/1GVMrRtf8zT3aCwZZ3ejZDepvcfxODtAlvip5vDTnZDuNvPMsVYA2k
         F0aw2z5sNIv5f/rHRDU4rNkazECKRHaaGLLfxQdlZPNgnOyvP+mfbuIQwPR/ISfL4cGj
         DHsrVvlk/HakkX0Y27LDECG4JVIMnfAwaDFuJl4kgSsJZbHIgKHTMGbmF/xd3+i8W/eQ
         KriA==
X-Gm-Message-State: ALoCoQn8DYZ9V5kTvZOy0HJJgdTv1N7c/KyFw7JWHttvquohWjkK1jpdb3Un/RFt0s8wUe1U4WiU
X-Received: by 10.42.40.147 with SMTP id l19mr10916776ice.34.1423216244462;
        Fri, 06 Feb 2015 01:50:44 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.25.132 with SMTP id 126ls796154ioz.31.gmail; Fri, 06 Feb
 2015 01:50:43 -0800 (PST)
X-Received: by 10.107.3.159 with SMTP id e31mr9902527ioi.65.1423216243755;
        Fri, 06 Feb 2015 01:50:43 -0800 (PST)
Original-Received: from mail-ie0-f172.google.com (mail-ie0-f172.google.com. [209.85.223.172])
        by mx.google.com with ESMTPS id v9si275750igd.54.2015.02.06.01.50.43
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 06 Feb 2015 01:50:43 -0800 (PST)
Received-SPF: none (google.com: mobi@mobiphil.com does not designate permitted sender hosts) client-ip=209.85.223.172;
Original-Received: by iery20 with SMTP id y20so55212ier.1
        for <std-proposals@isocpp.org>; Fri, 06 Feb 2015 01:50:43 -0800 (PST)
X-Received: by 10.107.8.67 with SMTP id 64mr9852942ioi.67.1423216243365; Fri,
 06 Feb 2015 01:50:43 -0800 (PST)
Original-Received: by 10.50.186.167 with HTTP; Fri, 6 Feb 2015 01:50:43 -0800 (PST)
In-Reply-To: <1932997.CYfMEhPeyI@tjmaciei-mobl4>
X-Original-Sender: mobi@mobiphil.com
X-Original-Authentication-Results: mx.google.com;       spf=none (google.com:
 mobi@mobiphil.com does not designate permitted sender hosts) smtp.mail=mobi@mobiphil.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: <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:16064
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/16064>

--001a113f8f8aa001f4050e685ae0
Content-Type: text/plain; charset=UTF-8

On Fri, Feb 6, 2015 at 2:04 AM, Thiago Macieira <thiago@macieira.org> wrote:

> On Friday 06 February 2015 01:06:54 mobi phil wrote:
> > > QSharedDataPointer does COW using operator->.
> > >
> > > However, it copies when you call the non-const operator->, even if your
> > > use is
> > > read-only.
> >
> > then you may agree that there would be some added value in such a
> > construct... Does not make sense to copy if the method is read-only,
> isn't
> > it?
>
> That doesn't work if I'm accessing a member.
>
> For example, the expression
>         type->member
>
> Is an lvalue and could be assigned to. But that doesn't mean that it is
> assigned to, so the operator-> would have no choice but to copy and assume
> that you do.
>

well, if you are directly accessing members, you would compromise the
implementation of COW, wouldn't you?

-- 

--- 
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/.

--001a113f8f8aa001f4050e685ae0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On Fri, Feb 6, 2015 at 2:04 AM, Thiago Macieira <span dir=3D"ltr">&lt;<=
a href=3D"mailto:thiago@macieira.org" target=3D"_blank">thiago@macieira.org=
</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin=
:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=3D"HOEn=
Zb"><div class=3D"h5">On Friday 06 February 2015 01:06:54 mobi phil wrote:<=
br>
&gt; &gt; QSharedDataPointer does COW using operator-&gt;.<br>
&gt; &gt;<br>
&gt; &gt; However, it copies when you call the non-const operator-&gt;, eve=
n if your<br>
&gt; &gt; use is<br>
&gt; &gt; read-only.<br>
&gt;<br>
&gt; then you may agree that there would be some added value in such a<br>
&gt; construct... Does not make sense to copy if the method is read-only, i=
sn&#39;t<br>
&gt; it?<br>
<br>
</div></div>That doesn&#39;t work if I&#39;m accessing a member.<br>
<br>
For example, the expression<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 type-&gt;member<br>
<br>
Is an lvalue and could be assigned to. But that doesn&#39;t mean that it is=
<br>
assigned to, so the operator-&gt; would have no choice but to copy and assu=
me<br>
that you do.<br>
<div class=3D"HOEnZb"><div class=3D"h5"></div></div></blockquote></div><br>
</div><div class=3D"gmail_extra">well, if you are directly accessing member=
s, you would compromise the implementation of COW, wouldn&#39;t you?</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 />

--001a113f8f8aa001f4050e685ae0--

.
