220 16062 <1932997.CYfMEhPeyI@tjmaciei-mobl4> article
Path: news.gmane.org!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: const T* operator->() const
Date: Thu, 05 Feb 2015 17:04:04 -0800
Lines: 34
Approved: news@gmane.org
Message-ID: <1932997.CYfMEhPeyI@tjmaciei-mobl4>
References: <56a7727d-9839-45c9-be72-a6ecb61f38c9@isocpp.org> <2900481.dbBOWPyqhq@tjmaciei-mobl4> <CAGMoNKveu2TKCFZnqAypP-bqZMzWfCPjOBb6AnUDbx776Tvu3g@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 1423184649 30887 80.91.229.3 (6 Feb 2015 01:04:09 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 6 Feb 2015 01:04:09 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBBVG2CTAKGQEONIEJXA@isocpp.org Fri Feb 06 02:04:09 2015
Return-path: <std-proposals+bncBCB4TK757YBRBBVG2CTAKGQEONIEJXA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-we0-f200.google.com ([74.125.82.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCB4TK757YBRBBVG2CTAKGQEONIEJXA@isocpp.org>)
	id 1YJXL6-0005U8-G1
	for gclcip-std-proposals@m.gmane.org; Fri, 06 Feb 2015 02:04:08 +0100
Original-Received: by mail-we0-f200.google.com with SMTP id m14sf8117856wev.3
        for <gclcip-std-proposals@m.gmane.org>; Thu, 05 Feb 2015 17:04:07 -0800 (PST)
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: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=ewZQV8rNFg8Om+8JhgcCJeKGxM+mRgt+hmzIprkAqJY=;
        b=X5EnUFSLpS3J3zO0C4yHn4vKt1dLDdJZRx1rjZcppYya7CTKgyEaaluMlYXjKEAkxC
         evAGgi3r/+o3iJ+m/2DKr4my3H8HgL6WrrEn/1ajEO5dC4I2cMDgDSWhmguFAR8F4bk6
         J47UKDPGE0SRSnauEJfzk/6QFrsOnhHB5a5yqgMaxy6mC7PTb+DfS+H38JB0+/cxvw47
         kmHUtADDFBAUM/g3NnDsnlXvgLnSCDE9G1yJSXwK9My14qEzh9gJbiPSzsREb8/VuHU+
         qAfPfTK3bZtz9VTvrVrMyvrpXc3aqZ5ccBPI75iaokcvZXNkMexONV6tZPOGLjFgXlmL
         iIxQ==
X-Gm-Message-State: ALoCoQlMzAKPbQqiLZSwWIeIQq53E3Vz4s5u0Wo0hz7kYeqo10X6k95QF08hRJnvZ+FYvaIs6/tM
X-Received: by 10.112.181.198 with SMTP id dy6mr91881lbc.22.1423184647717;
        Thu, 05 Feb 2015 17:04:07 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.101.1 with SMTP id fc1ls39553wib.16.canary; Thu, 05 Feb
 2015 17:04:06 -0800 (PST)
X-Received: by 10.194.2.240 with SMTP id 16mr2018600wjx.108.1423184646494;
        Thu, 05 Feb 2015 17:04:06 -0800 (PST)
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [2a01:4f8:d13:f81:21c:14ff:fe01:12a3])
        by mx.google.com with ESMTP id el2si1363619wid.21.2015.02.05.17.04.06
        for <std-proposals@isocpp.org>;
        Thu, 05 Feb 2015 17:04:06 -0800 (PST)
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-mobl4.localnet (jfdmzpr01-ext.jf.intel.com [134.134.139.70])
	by gondolin.macieira.info (Postfix) with ESMTPSA id BFC9C11A634
	for <std-proposals@isocpp.org>; Thu,  5 Feb 2015 17:04:05 -0800 (PST)
User-Agent: KMail/4.14.4 (Linux/3.11.10-25-desktop; KDE/4.14.4; x86_64; ; )
In-Reply-To: <CAGMoNKveu2TKCFZnqAypP-bqZMzWfCPjOBb6AnUDbx776Tvu3g@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.mail=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-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:16062
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/16062>

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.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

-- 

--- 
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/.

.
