220 27580 <2351486.cE391vEbrj@tjmaciei-mobl1> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: this in non-member functions
Date: Wed, 03 Aug 2016 14:04:19 -0700
Lines: 25
Approved: news@gmane.org
Message-ID: <2351486.cE391vEbrj@tjmaciei-mobl1>
References: <CAA7YVg3ObHqk-rfGRqgCqw3D-=u2pOwz=p8NHtC6n9tpBLq-Aw@mail.gmail.com> <cf5b6196-63bc-49ff-8a6a-bfdfb8a7ab0e@isocpp.org> <CAA7YVg2BQaVD2MyLyyEWuzWUnqjGrNUUi9eZwy7skjq8=ourvA@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: blaine.gmane.org 1470258269 25521 195.159.176.226 (3 Aug 2016 21:04:29 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 3 Aug 2016 21:04:29 +0000 (UTC)
User-Agent: KMail/5.2.3 (Linux/4.6.4-1-default; KDE/5.23.0; x86_64; ; )
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBVVYRG6QKGQENOHFECQ@isocpp.org Wed Aug 03 23:04:24 2016
Return-path: <std-proposals+bncBCB4TK757YBRBVVYRG6QKGQENOHFECQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f70.google.com ([209.85.215.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCB4TK757YBRBVVYRG6QKGQENOHFECQ@isocpp.org>)
	id 1bV3Kx-00065N-NW
	for gclcip-std-proposals@m.gmane.org; Wed, 03 Aug 2016 23:04:23 +0200
Original-Received: by mail-lf0-f70.google.com with SMTP id e7sf121181114lfe.0
        for <gclcip-std-proposals@m.gmane.org>; Wed, 03 Aug 2016 14:04:24 -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=NpWBu/yK8RGfW1+szq6aUFwKv9fVd3cxNSEh6MRn6Tk=;
        b=m2e+FvM+Zgkrwawn0eqiKPPpkF798lUKfMYAHo3eS3iH9a4SwEjwu7pGkUf8/kuG1y
         vB/j5gkJshxQvGPhZ1c1EVpregMYwA3Bxfw+vUSDSbu9pGQl/PcqtjC1+yjEALQzDHWc
         t/cNqNnln7tvtda0o4abykCG9V9YUQTA8CFJYzUiZj2OOByhd/0KDqOvNlw5sVtX3F8y
         RAlZUTKszPcYgxsdr8/YprBA8z8XUheCPphb5PZH9z34yE4eDVjyWEZAWPBuDsbIrMHV
         lUYupojjbzR0tlhs5YHcYEjJ8dPKsl+9ZQ4ddLlo2ksBAcgU3BODPCNQUg7JRJwZrymp
         zXPg==
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=NpWBu/yK8RGfW1+szq6aUFwKv9fVd3cxNSEh6MRn6Tk=;
        b=L9BaMsxvt+vC06R1N6RWyDyRJoh/LUKaQd0FSNOO6wuq21WIm3jqj6j2YgEsaR3P21
         RWkBZtuGTGB7yQ2dd0JoC/1Zc0C6wqv8Fy8acvo4BypgFqNmkOzbkT1saQexk86OvALL
         ipnNyB7tZjZKRu/pKy3d/1MunXEKunTBkQdS1AASLAmIYVIoBPIXg8YiA3IgrlKK4O/q
         fdhZOt90aO6zijt+hAVIP+q4VMBv1GG6neO4e7ckr0v8xOxIKttnKVL6Z07Wh85bO7cd
         ak9+dfnpThhbi74p5RlS3izYuajGq2SAY82+Q+BGBiDk3ESM8/oh3KpjGPFkmcYVJfUx
         yZ7g==
X-Gm-Message-State: AEkoousx1LeitX8vqHEUPx79IOD5SfPLfWyS7z61XT/pe5ztrD0jCz1VZG0ZAfn75ZntxA==
X-Received: by 10.46.32.69 with SMTP id g66mr9483210ljg.8.1470258263923;
        Wed, 03 Aug 2016 14:04:23 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.166.140 with SMTP id p134ls7960wme.22.canary; Wed, 03 Aug
 2016 14:04:22 -0700 (PDT)
X-Received: by 10.194.85.97 with SMTP id g1mr61545572wjz.72.1470258262254;
        Wed, 03 Aug 2016 14:04:22 -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 11si240225wmd.108.2016.08.03.14.04.21
        for <std-proposals@isocpp.org>;
        Wed, 03 Aug 2016 14:04:21 -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 [134.134.139.82])
	by gondolin.macieira.info (Postfix) with ESMTPSA id 5666011A665
	for <std-proposals@isocpp.org>; Wed,  3 Aug 2016 14:04:21 -0700 (PDT)
In-Reply-To: <CAA7YVg2BQaVD2MyLyyEWuzWUnqjGrNUUi9eZwy7skjq8=ourvA@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-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:27580
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/27580>

On quarta-feira, 3 de agosto de 2016 14:37:14 PDT Viacheslav Usov wrote:
> void foo(A *this) { x = 1; }
> 
> is equivalent to
> 
> void foo(A *ptr) { ptr->x = 1; }

Understood, but is this the only benefit? Is it worth the hassle for saving a 
few keystrokes?

Also note that it's not a member function, so it can't access protecteds and 
privates of the object.

I'm not opposed to it, but if the gain is that small...

-- 
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/2351486.cE391vEbrj%40tjmaciei-mobl1.

.
