220 16060 <2900481.dbBOWPyqhq@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 16:03:14 -0800
Lines: 39
Approved: news@gmane.org
Message-ID: <2900481.dbBOWPyqhq@tjmaciei-mobl4>
References: <56a7727d-9839-45c9-be72-a6ecb61f38c9@isocpp.org> <a4dccbc1-16ef-49cb-927f-476416c7a369@isocpp.org> <CAGMoNKujqEBKeJbK-_Nen5NcwXhZN9AUxrjJkxAfFXBOO7ZQ6w@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 1423181003 9161 80.91.229.3 (6 Feb 2015 00:03:23 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 6 Feb 2015 00:03:23 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBSMJ2CTAKGQEQYM2DTY@isocpp.org Fri Feb 06 01:03:22 2015
Return-path: <std-proposals+bncBCB4TK757YBRBSMJ2CTAKGQEQYM2DTY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-we0-f197.google.com ([74.125.82.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCB4TK757YBRBSMJ2CTAKGQEQYM2DTY@isocpp.org>)
	id 1YJWOI-00022l-Dv
	for gclcip-std-proposals@m.gmane.org; Fri, 06 Feb 2015 01:03:22 +0100
Original-Received: by mail-we0-f197.google.com with SMTP id l61sf7972445wev.0
        for <gclcip-std-proposals@m.gmane.org>; Thu, 05 Feb 2015 16:03:21 -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=+eXkhpHMRp6PrJWexRCnnSi7XV1oKLOQ24HB/cdg6vk=;
        b=S9DVIk0sjjbJd/WSJtjQdLxNlTU/MlorXvWHtIKy4kVVZwwPFQEgSvOnpZaphhj+J2
         YrlJ8UcYwNvPJNCwH1/ZTVidMLducAybg5cV87IB6RTKJAj1QblgWnCgConECTEf9l72
         FL/tO4BjSYHTdVOsuq2/AEliF8w1JaFdd3SQ41kKSPxT8ROY0Vm1YANAJys8Tic+9xbd
         X+FxccfWaX4Ny1bT15Siu6Qq4eIy9xCoMTNZxVd5/Sbckw/VAoX5tMkQvZKyYlAPNqV+
         miBCMQUSjf5LPJNMZ+LdpIpWvPk5uN2Q+CyIY4Dfsj6jaoNSszQc55m2ODIkGST5T7R+
         QxoQ==
X-Gm-Message-State: ALoCoQmHXtWUBV+1E75PTWjCbrEE1MVZwEQdXIO5g+g+F1jPT0Y9DTyPcw9HTsbRkXdf0Qt0kxkW
X-Received: by 10.152.243.3 with SMTP id wu3mr76455lac.6.1423181001855;
        Thu, 05 Feb 2015 16:03:21 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.12.139 with SMTP id y11ls36748wib.9.canary; Thu, 05 Feb
 2015 16:03:20 -0800 (PST)
X-Received: by 10.180.37.33 with SMTP id v1mr1594620wij.76.1423181000636;
        Thu, 05 Feb 2015 16:03:20 -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 li1si1200144wjc.90.2015.02.05.16.03.18
        for <std-proposals@isocpp.org>;
        Thu, 05 Feb 2015 16:03:18 -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 DB82011A60E
	for <std-proposals@isocpp.org>; Thu,  5 Feb 2015 16:03:16 -0800 (PST)
User-Agent: KMail/4.14.4 (Linux/3.11.10-25-desktop; KDE/4.14.4; x86_64; ; )
In-Reply-To: <CAGMoNKujqEBKeJbK-_Nen5NcwXhZN9AUxrjJkxAfFXBOO7ZQ6w@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:16060
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/16060>

On Thursday 05 February 2015 22:23:32 mobi phil wrote:
> Well... ideas are often coming from mistakes that are conceptually not
> necessarily mistakes in a certain context.
> The "->" operator is an unary operator, though intuitively myself I tend
> often to think it as as a binary operator, with second parameter what is on
> the right side. Definitively the language would be richer if there would be
> a mechanism to have overload also based on the right hand. Obviously one
> would need to support stuff like:
> 
> (this is rather meta-C++)
> template<Type>
>   Widget::operator->(  RightHandType ) {
>       return (what is intended).RightHandType;
> }
> 
> but this is just yet another mental-*turbation, far from ever taken
> seriously.
> 
> Definitively it would help to implement what I thought for COW.

QSharedDataPointer does COW using operator->.

However, it copies when you call the non-const operator->, even if your use is 
read-only.

-- 
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/.

.
