220 40818 <988bb886-95a1-4484-9461-824368477145@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: mutant.sheepdog@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Pointer to pointer representation
Date: Mon, 29 Oct 2018 14:46:08 -0700 (PDT)
Lines: 117
Approved: news@gmane.org
Message-ID: <988bb886-95a1-4484-9461-824368477145@isocpp.org>
References: <eeb29435-11b6-424e-8434-c0aeef0977f1@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1957_270047720.1540849569036"
X-Trace: blaine.gmane.org 1540849446 27470 195.159.176.226 (29 Oct 2018 21:44:06 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 29 Oct 2018 21:44:06 +0000 (UTC)
Cc: tecoberg@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDV57NMMVALBBIX73XPAKGQEIDR6QUI@isocpp.org Mon Oct 29 22:44:02 2018
Return-path: <std-proposals+bncBDV57NMMVALBBIX73XPAKGQEIDR6QUI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yb1-f199.google.com ([209.85.219.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDV57NMMVALBBIX73XPAKGQEIDR6QUI@isocpp.org>)
	id 1gHFKL-000729-JC
	for gclcip-std-proposals@m.gmane.org; Mon, 29 Oct 2018 22:44:01 +0100
Original-Received: by mail-yb1-f199.google.com with SMTP id z1-v6sf7440565ybf.4
        for <gclcip-std-proposals@m.gmane.org>; Mon, 29 Oct 2018 14:46:12 -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:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=ODh8WU20Tuf1wp6brC3fRKuJ7UTavSSkFwOyde7Kfrg=;
        b=bN2M8quGnE1Q8kfcMG4tDJKYaYh2+5G1nd0iFoXrNBu7p+3Sg7wnjpm3ZXoAFjhF13
         8u7ToMlsAmsRrM5c7+GDRgaFrthdkJRwD08+0jOs0gJ8eQUaLKET7BkKJ+4p3bMbrI5Y
         F5HLgl55abVfaBg9kwS8d+88hMcRVDFLx5HWwp/p6v2cUcudbiH9RFz2+oIqczWE+rdB
         IchXcmqAfL0A4B74UC12mcH9/ZzOnlIvCGbMJVFAsK0PPCI5hvy5+U7QOahlfih5E8Bg
         V0t/KyZenY9Ok20DHKuqPulJNmy78CFQrfkA3fl/AcYAEr96VOaW34xYmSFGwnJqRE1N
         rMiA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=ODh8WU20Tuf1wp6brC3fRKuJ7UTavSSkFwOyde7Kfrg=;
        b=NIyJiQ0FW85zaPp1NOkMS5DwGuo/YK3LuEc7NxweLBLmiHqjIt+28DBTSg2/VZeAKQ
         dkbZnObcFR0e7q1JCoIXwF/me8/aaga9dwOcDTYbsOH2k4IL2ZzKnIgi7Eh9Ka3SePZL
         VCySLMgz0QlEYcMjl10aSHlJjvULHjOiZ4S6wMb497n+tKJfCNuR8jzSfq6vz/jEnDZZ
         Tb5o5doVdpIAaxDwY2ndwk1ZeDKaYM6YGA9HUZL4fqMf+9vYXqUOPfJRzKbJC6t4AGgq
         FmNmOtihY88dfd3kX2Me0i0hF/e7p5erB29PzhIHU/G47hWVoybIbFIRBPTjju71ui5b
         ciRw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        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=ODh8WU20Tuf1wp6brC3fRKuJ7UTavSSkFwOyde7Kfrg=;
        b=uPkGKqkPJ5yn9zYFcxaYHrNWXX8qHrFGoBg+gmP1h6dGOHJn8xafepPXQ44b+PZIZ7
         /f21oxUIwG7bRyQwve49+U5225MZDivaiTPQXFGZQ/YMTb5wd0VpEBlHEZYKqx2MT0A2
         4AdIXyzwCxmvJyJL9DVn1BbmXD2v3YXJ/orPFZjZTN6CMN2xXNM+q/xLioqvYW2vcSgc
         5+qnupMimbxncudrzrcpfDiLSHnEFzGYVa2sqQRYbIcewmJH5XGtqK8RbIsZtRvVzsD6
         9gu7x07fcm2EhCye3+EOTsekpMfgvXjKILOcYoQptv1ZgV6nV0QgzJfQOhlBxy3mQ8le
         1FRg==
X-Gm-Message-State: AGRZ1gI4venHgefpHPQ3zRFE9KxwJ2yCvEq6hDzMPk/sPh8SB2/j26vV
	ERBGTKE+JxdhOHsXzAiRrlKtwA==
X-Google-Smtp-Source: AJdET5dvu7cV+oADgcdYgKlWs1RQv2tkAL2PmaLqjoeVjgXbnhvQzIpb6pGDrhJWVC4M0uMmj0GKyw==
X-Received: by 2002:a81:ae18:: with SMTP id m24-v6mr94462ywh.15.1540849571788;
        Mon, 29 Oct 2018 14:46:11 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a81:3d45:: with SMTP id k66-v6ls5754031ywa.11.gmail; Mon, 29
 Oct 2018 14:46:10 -0700 (PDT)
X-Received: by 2002:a0d:d703:: with SMTP id z3-v6mr665ywd.7.1540849569947;
        Mon, 29 Oct 2018 14:46:09 -0700 (PDT)
In-Reply-To: <eeb29435-11b6-424e-8434-c0aeef0977f1@isocpp.org>
X-Original-Sender: Mutant.Sheepdog@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: 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:40818
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/40818>

------=_Part_1957_270047720.1540849569036
Content-Type: multipart/alternative; 
	boundary="----=_Part_1958_886195860.1540849569036"

------=_Part_1958_886195860.1540849569036
Content-Type: text/plain; charset="UTF-8"

I don't think pointer-pointers are common enough to warrant adding their 
own operator to the language when (*ptp)->FuncMember() and 
**ptp.FuncMember() already work well enough.

I can think of 2 main situations where I've run into pointer pointers.
The first is functions that return a handle via an out param (which could 
be replaced with an optional return val) and in those cases you wouldn't 
typically be dereferencing the pointer-pointer in the body of the function, 
and the calling function would probably only have a regular pointer 
(passing the address of the pointer into the function).
The second case is iterators to pointers and in those cases it would often 
better to use (*ptp)-> anyway so that the iterator type could change 
without the dereference having to change.

I feel that pointer-pointers should be rare, and shouldn't get special 
syntax when existing syntax works.


On Monday, 29 October 2018 18:00:15 UTC+11, teco...@gmail.com wrote:
>
> Hi, 
>
> If we have a container of unitque_ptr/shared_ptr objects, to reference to 
> them we can usethe follow notations:
>
> *p->FuncMember();*   //Same as *(*p).FuncMember();*
>
> but, some times I need to create a pointer to this pointer and I use to 
> write the follow notation:
>
> *(*p2p)->FuncMember();*
>
> I think it will be a good idea if c++ could have a notation to this 
> situations like:
>
> *p2p=>FuncMember() *//or
>
> *p2p+>FuncMember()* //or
>
> *p2p#>FuncMember()* //or
>
> *p2p:>FuncMember()*
>
> What do you think?
>
> I hope I helped in some way.
>
>
>

-- 
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/988bb886-95a1-4484-9461-824368477145%40isocpp.org.

------=_Part_1958_886195860.1540849569036
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>I don&#39;t think pointer-pointers are common enough =
to warrant adding their own operator to the language when (*ptp)-&gt;FuncMe=
mber() and **ptp.FuncMember() already work well enough.</div><div><br></div=
><div>I can think of 2 main situations where I&#39;ve run into pointer poin=
ters.<br>The first is functions that return a handle via an out param (whic=
h could be replaced with an optional return val) and in those cases you wou=
ldn&#39;t typically be dereferencing the pointer-pointer in the body of the=
 function, and the calling function would probably only have a regular poin=
ter (passing the address of the pointer into the function).</div><div>The s=
econd case is iterators to pointers and in those cases it would often bette=
r to use (*ptp)-&gt; anyway so that the iterator type could change without =
the dereference having to change.<br></div><div><br></div><div>I feel that =
pointer-pointers should be rare, and shouldn&#39;t get special syntax when =
existing syntax works.</div><div><br></div><br>On Monday, 29 October 2018 1=
8:00:15 UTC+11, teco...@gmail.com  wrote:<blockquote class=3D"gmail_quote" =
style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-l=
eft: 1ex;"><div dir=3D"ltr"><div>Hi,=C2=A0</div><div><br></div><div>If we h=
ave a container of unitque_ptr/shared_ptr objects, to reference to them we =
can usethe follow notations:</div><div><br></div><div><b>p-&gt;FuncMember()=
;</b>=C2=A0=C2=A0 //Same as <b>(*p).FuncMember();</b></div><div><br></div><=
div>but, some times I need to create a pointer to this pointer and I use to=
 write the follow notation:</div><div><br></div><div><b>(*p2p)-&gt;FuncMemb=
er();</b></div><div><br></div><div>I think it will be a good idea if c++ co=
uld have a notation to this situations like:</div><div><br></div><div><b>p2=
p=3D&gt;FuncMember() </b>//or</div><div><br></div><div><b>p2p+&gt;FuncMembe=
r()</b> //or</div><div><br></div><div><b>p2p#&gt;FuncMember()</b> //or</div=
><div><br></div><div><b>p2p:&gt;FuncMember()</b><br></div><div><br></div><d=
iv>What do you think?</div><div><br></div><div>I hope I helped in some way.=
<br></div><div><br></div><div><br></div></div></blockquote></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/988bb886-95a1-4484-9461-824368477145%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/988bb886-95a1-4484-9461-824368477145=
%40isocpp.org</a>.<br />

------=_Part_1958_886195860.1540849569036--

------=_Part_1957_270047720.1540849569036--

.
