220 27636 <77b65a95-52c4-4191-8b65-764591aa6b2c@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: this in non-member functions
Date: Fri, 5 Aug 2016 10:53:16 -0700 (PDT)
Lines: 144
Approved: news@gmane.org
Message-ID: <77b65a95-52c4-4191-8b65-764591aa6b2c@isocpp.org>
References: <CAA7YVg3ObHqk-rfGRqgCqw3D-=u2pOwz=p8NHtC6n9tpBLq-Aw@mail.gmail.com>
 <cf5b6196-63bc-49ff-8a6a-bfdfb8a7ab0e@isocpp.org> <CAA7YVg2BQaVD2MyLyyEWuzWUnqjGrNUUi9eZwy7skjq8=ourvA@mail.gmail.com>
 <2351486.cE391vEbrj@tjmaciei-mobl1> <CACGiwhEAN4R2xE9g84xk6KKDB76+PpLFUt_Af6aKhDpAMf8Lqw@mail.gmail.com>
 <nnv12b$okq$1@blaine.gmane.org>
 <CAA7YVg3jtYJ8JdLqqvN1eGx0L21Bef2J-atc0_ufUwKxtsiVSQ@mail.gmail.com>
 <814750ea-1ef8-4792-9b50-aec0bae4d841@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2280_1148085141.1470419596371"
X-Trace: blaine.gmane.org 1470419625 12993 195.159.176.226 (5 Aug 2016 17:53:45 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 5 Aug 2016 17:53:45 +0000 (UTC)
Cc: inkwizytoryankes@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBDNFSO6QKGQEGI3FGYQ@isocpp.org Fri Aug 05 19:53:37 2016
Return-path: <std-proposals+bncBCEKFTV6ZUMBBDNFSO6QKGQEGI3FGYQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qt0-f197.google.com ([209.85.216.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBDNFSO6QKGQEGI3FGYQ@isocpp.org>)
	id 1bVjJ9-0008TG-3k
	for gclcip-std-proposals@m.gmane.org; Fri, 05 Aug 2016 19:53:19 +0200
Original-Received: by mail-qt0-f197.google.com with SMTP id 101sf483645196qtb.0
        for <gclcip-std-proposals@m.gmane.org>; Fri, 05 Aug 2016 10:53:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=UH9v8xidJhA4PgfQqc/y9rdAV9i+QtmIr3J+4AR6G7Y=;
        b=ZJ5FBx7G7JyeRQBTmiGGYntIlpE6MRxKq1mqm8BEZz7mpgCe9J75P8VG/dGcjfgnZW
         ZfZazJCS7zhAbHetICWN1mIUffDldSZbXUZ5cZcatdRMhiXqCuzSkm8d8g98cPddLAoy
         BBmxpyHFRLXJAtLDPc9KA0sJRTHqR0O7SjsjP4vFxisaQ2WCgGN1vP3j9+vqoZ9DAc/D
         K7Jf5a1eqdW+vFGxFpOk8us0EKitlbh3dh2x9p2MgJIG4ExUfLuFkNqEJO5V4rC046Qp
         hhBrEayeAFApGU54Ww0oQnWDYcVGmnwWJ8j3YgHqwAaOkP1as84rOsdoX+DrNnF2raO0
         fMrg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=UH9v8xidJhA4PgfQqc/y9rdAV9i+QtmIr3J+4AR6G7Y=;
        b=fQzyG3YQ8H9c9MDR6hoeTrygeDgEWVUIHCCWgKhW5hlNh+elzSY1oFfstObgG/OX2I
         8YDG6gp3XZPRYbd9j4l4YVNjHwYq0yZx6+HBL/aFDxE3OEYmxucZ0GuAuyigrr6P/Biy
         lIJVe1lLMQy3V9eWK0WX1bGjtjvk7Kn7Y9U9pMtboCq/lD4dA6w/ymwz5gfGUnW2oIpf
         C3YVTcuTWifzNZPzO2EzOysxtAHvNHb/Q52bzev+f4UBjVe18H2UzV/axHqzyvGFO4HC
         YPLR8w4H9i9XEMJEJBnkK+MqHpQn+MlCyt+PwRLK6oR9uAYSANCSr70FjGKzbsnTeNEl
         PCaw==
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:x-original-sender:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=UH9v8xidJhA4PgfQqc/y9rdAV9i+QtmIr3J+4AR6G7Y=;
        b=Ev0jZqM7jRmZx+MUcAOvi4T0k6jP4GiBHOqo9MHjAHDRWfJEIpkg5Q2nQoL4XbXZ8J
         82sssYI/YrY++z0fAZ2bwlZ6wW/UR0jdX+j/oDxFHAUbe6fDQ/lz79C6RTR7GWEk+GLm
         KIRHcoI8UZsljjOOmFS+IhSZFmqzExH53rOZ93KXiHUEBj5Ye9RW0rJPaqhwzx3BRcjI
         kd7OO+kI4LAnFrzjmm+rVzf6jsv2s7KAzkfbd7UOeOy7RZntsHf+TiB5tovrGty3Z4VE
         XR/icC66PkDimMSwVdE+e4YbslAOdsP7LTUc2AhSZncUPdKRy+hLP+wsLi3pBdYEQbI6
         yT6g==
X-Gm-Message-State: AEkoouvQZvrX3MLPZXMgCBBBKxe9yoKkgC3OSD0oOUL38ieKj8uOnPVVCR/iS8xru225NA==
X-Received: by 10.129.92.67 with SMTP id q64mr54906963ywb.34.1470419598988;
        Fri, 05 Aug 2016 10:53:18 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.19.150 with SMTP id 22ls2547429iot.17.gmail; Fri, 05 Aug
 2016 10:53:17 -0700 (PDT)
X-Received: by 10.36.217.2 with SMTP id p2mr210426itg.5.1470419597382;
        Fri, 05 Aug 2016 10:53:17 -0700 (PDT)
In-Reply-To: <814750ea-1ef8-4792-9b50-aec0bae4d841@isocpp.org>
X-Original-Sender: jmckesson@gmail.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: <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:27636
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/27636>

------=_Part_2280_1148085141.1470419596371
Content-Type: multipart/alternative; 
	boundary="----=_Part_2281_1596674207.1470419596371"

------=_Part_2281_1596674207.1470419596371
Content-Type: text/plain; charset=UTF-8

On Friday, August 5, 2016 at 1:17:10 PM UTC-4, inkwizyt...@gmail.com wrote:
>
> On Thursday, August 4, 2016 at 12:26:36 PM UTC+2, Viacheslav Usov wrote:
>>
>> On Thu, Aug 4, 2016 at 11:14 AM, Bo Persson <b...@gmb.dk> wrote:
>>
>> > Yes, I would definitely be confused by the sublety of the parameter 
>> name.
>>
>> I hope everybody has read the original message in the thread.
>>
>> As a reminder, this is not only about parameters, and the public-only 
>> binding was mentioned there. The confusion that can arise because of the 
>> public-only binding ("first kind") and because of misspelled identifiers 
>> ("second kind") is not something new that this proposal would introduce. 
>> The first kind is present, for example, in this:
>>
>> struct A
>> {
>>     int x;
>> private:
>>     int y;
>> };
>>
>> struct B: A
>> {
>>     void foo()
>>     {
>>         x = 1; // OK
>>         y = 2; // error
>>     }
>> };
>>
>> The second kind is always just around the corner in any C++ program.
>>
>> int she;
>> struct foo
>> {
>>     int he;
>>     void bar() { she = 1; } // really?
>> ];
>>
>> Cheers,
>> V.
>>
>>
>
> And what about templates?
> template<typename T>
> void f(T* this)
> {
>     a = 6;
> };
> What meaning have this code? `a` is member or global value?
>

It would be whatever it would be if `f` were actually a non-static member 
of `T`. God only knows how you'd actually define that in the standard 
though.

-- 
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/77b65a95-52c4-4191-8b65-764591aa6b2c%40isocpp.org.

------=_Part_2281_1596674207.1470419596371
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Friday, August 5, 2016 at 1:17:10 PM UTC-4, inkwizyt...=
@gmail.com wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr">On Thursday, August 4, 2016 at 12:26:36 PM UTC+2, Viacheslav Usov wrote=
:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;bord=
er-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><div class=
=3D"gmail_quote">On Thu, Aug 4, 2016 at 11:14 AM, Bo Persson <span dir=3D"l=
tr">&lt;<a rel=3D"nofollow">b...@gmb.dk</a>&gt;</span> wrote:</div><div cla=
ss=3D"gmail_quote"><br></div><div class=3D"gmail_quote">&gt; Yes, I would d=
efinitely be confused by the sublety of the parameter name.</div><div class=
=3D"gmail_quote"><div><br></div><div>I hope everybody has read the original=
 message in the thread.</div><div><br></div><div>As a reminder, this is not=
 only about parameters, and the public-only binding was mentioned there. Th=
e confusion that can arise because of the public-only binding (&quot;first =
kind&quot;) and because of misspelled identifiers (&quot;second kind&quot;)=
 is not something new that this proposal would introduce. The first kind is=
 present, for example, in this:</div><div><br></div><div>struct A</div><div=
>{</div><div>=C2=A0 =C2=A0 int x;</div><div>private:</div><div>=C2=A0 =C2=
=A0 int y;</div><div>};</div><div><br></div><div>struct B: A</div><div>{</d=
iv><div>=C2=A0 =C2=A0 void foo()</div><div>=C2=A0 =C2=A0 {</div><div>=C2=A0=
 =C2=A0 =C2=A0 =C2=A0 x =3D 1; // OK</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
y =3D 2; // error</div><div>=C2=A0 =C2=A0 }</div><div>};</div><div><br></di=
v><div>The second kind is always just around the corner in any C++ program.=
<br></div><div><br></div><div>int she;<br></div><div>struct foo<br></div><d=
iv>{</div><div>=C2=A0 =C2=A0 int he;</div><div>=C2=A0 =C2=A0 void bar() { s=
he =3D 1; } // really?</div><div>];</div><div><br></div><div>Cheers,<br></d=
iv><div>V.</div><div><br></div></div></div></div></blockquote><div><br><br>=
And what about templates?<br><div style=3D"background-color:rgb(250,250,250=
);border-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wr=
ap:break-word"><code><div><span style=3D"color:#008">template</span><span s=
tyle=3D"color:#660">&lt;</span><span style=3D"color:#008">typename</span><s=
pan style=3D"color:#000"> T</span><span style=3D"color:#660">&gt;</span><sp=
an style=3D"color:#000"><br></span><span style=3D"color:#008">void</span><s=
pan style=3D"color:#000"> f</span><span style=3D"color:#660">(</span><span =
style=3D"color:#000">T</span><span style=3D"color:#660">*</span><span style=
=3D"color:#000"> </span><span style=3D"color:#008">this</span><span style=
=3D"color:#660">)</span><span style=3D"color:#000"><br></span><span style=
=3D"color:#660">{</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 a </sp=
an><span style=3D"color:#660">=3D</span><span style=3D"color:#000"> </span>=
<span style=3D"color:#066">6</span><span style=3D"color:#660">;</span><span=
 style=3D"color:#000"><br></span><span style=3D"color:#660">};</span><span =
style=3D"color:#000"><br></span></div></code></div>What meaning have this c=
ode? `a` is member or global value?<br></div></div></blockquote><div><br>It=
 would be whatever it would be if `f` were actually a non-static member of =
`T`. God only knows how you&#39;d actually define that in the standard thou=
gh.<br></div></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/77b65a95-52c4-4191-8b65-764591aa6b2c%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/77b65a95-52c4-4191-8b65-764591aa6b2c=
%40isocpp.org</a>.<br />

------=_Part_2281_1596674207.1470419596371--

------=_Part_2280_1148085141.1470419596371--

.
