220 20992 <CAOHCbivvwteOpeDWUTRA-oWNr_0KS=kgSbrSVu+b3OvKQaj6gw@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Tony V E <tvaneerd@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: auto return
Date: Tue, 29 Sep 2015 16:27:34 -0400
Lines: 120
Approved: news@gmane.org
Message-ID: <CAOHCbivvwteOpeDWUTRA-oWNr_0KS=kgSbrSVu+b3OvKQaj6gw@mail.gmail.com>
References: <CAB+4KHLBYKxVQsSd_Q-LybNLdx5W9vLJ1HKY6Um8Lwe7vVKE1w@mail.gmail.com>
	<7deedcff-6776-4b3b-a3d1-3132f8ec1ae3@isocpp.org>
	<CAB+4KHJ-8aY9AF6fOzi6ZUv1=Mfqe-9BVKe6Ou+X_KXQk_zM3g@mail.gmail.com>
	<489434f4-b703-4b0a-ad28-833899af1e14@isocpp.org>
	<CANCWpS_DU5nDQ=6qM7NsdoS3Rq+qfh2vpFTsKWQxR1BSXWpt_w@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=089e013d0ffce685090520e8a4c9
X-Trace: ger.gmane.org 1443558460 7677 80.91.229.3 (29 Sep 2015 20:27:40 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 29 Sep 2015 20:27:40 +0000 (UTC)
To: Standard Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCUZ5QWKNQILP2FLWACRUBBAEN55M@isocpp.org Tue Sep 29 22:27:40 2015
Return-path: <std-proposals+bncBCUZ5QWKNQILP2FLWACRUBBAEN55M@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wi0-f200.google.com ([209.85.212.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCUZ5QWKNQILP2FLWACRUBBAEN55M@isocpp.org>)
	id 1Zh1Uv-0000L7-Gj
	for gclcip-std-proposals@m.gmane.org; Tue, 29 Sep 2015 22:27:37 +0200
Original-Received: by wicuu12 with SMTP id uu12sf11585762wic.2
        for <gclcip-std-proposals@m.gmane.org>; Tue, 29 Sep 2015 13:27:36 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:content-type: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=Uiqebq7h5YS2nrvEdJeGxrIRKH08LF4+x1XIGhl6ePk=;
        b=Iezkju0bYOZKxOqa5ziwaeaa4GseANnzUtMU0Ge/SgP/7ks6jYRaI/wVEnqkoXuLsp
         wI5jKRKmQcZ5qMOOM9e6VCzq/VtGQxC7aPeDny29Un3ECjHViTZjuMqAvZPVSYZLVtoH
         W0diKk6XgyX1p5W2Db0tX8JtPmrjiPRpVGo75x0uO+6xrtdejVDB5uogi9RXF04W7t1k
         EQnjHA82QgOiF737lp6ymP8o26VS9b0aFKndrx/PKyVehlQhar2Ah7AidV1ZThJ2linS
         PZkjoeryypKQyLZ9LQmpfDPPIEp27po/4yEn8Jv0Gpg+lLXUuHK8VHg6AiA/gU8B5ROU
         oHcg==
X-Gm-Message-State: ALoCoQkgGBnz79ZsHHgHLxQ0mO4Dc2BIoJ+tqMpsjtAtrOhlT0RKlqVzDMFgaubuMnCx0YGU5xMg
X-Received: by 10.112.170.67 with SMTP id ak3mr4505327lbc.6.1443558456713;
        Tue, 29 Sep 2015 13:27:36 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.25.160.75 with SMTP id j72ls1169lfe.106.gmail; Tue, 29 Sep
 2015 13:27:35 -0700 (PDT)
X-Received: by 10.112.134.73 with SMTP id pi9mr7970653lbb.83.1443558454981;
        Tue, 29 Sep 2015 13:27:34 -0700 (PDT)
Original-Received: from mail-la0-x236.google.com (mail-la0-x236.google.com. [2a00:1450:4010:c03::236])
        by mx.google.com with ESMTPS id z7si11754943lbf.45.2015.09.29.13.27.34
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 29 Sep 2015 13:27:34 -0700 (PDT)
Received-SPF: pass (google.com: domain of tvaneerd@gmail.com designates 2a00:1450:4010:c03::236 as permitted sender) client-ip=2a00:1450:4010:c03::236;
Original-Received: by labzv5 with SMTP id zv5so22871728lab.1
        for <std-proposals@isocpp.org>; Tue, 29 Sep 2015 13:27:34 -0700 (PDT)
X-Received: by 10.152.5.133 with SMTP id s5mr7963682las.19.1443558454622; Tue,
 29 Sep 2015 13:27:34 -0700 (PDT)
Original-Received: by 10.112.199.106 with HTTP; Tue, 29 Sep 2015 13:27:34 -0700 (PDT)
In-Reply-To: <CANCWpS_DU5nDQ=6qM7NsdoS3Rq+qfh2vpFTsKWQxR1BSXWpt_w@mail.gmail.com>
X-Original-Sender: tvaneerd@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of tvaneerd@gmail.com designates 2a00:1450:4010:c03::236 as permitted
 sender) smtp.mailfrom=tvaneerd@gmail.com;       dkim=pass header.i=@gmail.com;
       dmarc=pass (p=NONE dis=NONE) header.from=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: <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:20992
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/20992>

--089e013d0ffce685090520e8a4c9
Content-Type: text/plain; charset=UTF-8

On Tue, Sep 29, 2015 at 4:08 PM, little3lue <little3lue@gmail.com> wrote:

> Some languages allow creating a named variable for the return type, as
> part of the function definition.
>
> E.g. strawman:
>
> // foo.h
> Foo getFoo();
>
> // foo.cpp
> (Foo foo) getFoo() {
>   // foo is initialized and "automatically returned" unless another value
> is explicitly returned
>   foo.fizzle();
> }
>
> // Or maybe:
> auto getFoo -> Foo foo {
> }
>
> -Michal
>
> On Tue, Sep 29, 2015 at 10:09 AM Nicol Bolas <jmckesson@gmail.com> wrote:
>
>> On Tuesday, September 29, 2015 at 2:28:58 AM UTC-4, Andrew Tomazos wrote:
>>>
>>>
>>>>>   std::vector<std::pair<int,int>> build_points() {
>>>>>     while (c) return.emplace_back(g(c),h(c));
>>>>>   }
>>>>>
>>>>
>>

And some languages allow you to use the function name:

Foo getFoo() {
   getFoo = lookup(...);
}


I don't like any of these suggestions (just aesthetically, they don't
look/feel like C++ to me) and don't think the committee should spend time
on this area - I don't think it is worth it.  Committee time is finite, and
expensive.  There are better things to spend it on. IMO.
(and feel free to say the same of my proposals, if that's your opinion)

Tony

-- 

--- 
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/.

--089e013d0ffce685090520e8a4c9
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On Tue, Sep 29, 2015 at 4:08 PM, little3lue <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:little3lue@gmail.com" target=3D"_blank">little3lue@gmail.com</=
a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0=
 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Som=
e languages allow creating a named variable for the return type, as part of=
 the function definition.<div><br></div><div>E.g. strawman:</div><div><br><=
/div><div>// foo.h</div><div>Foo getFoo();</div><div><br></div><div>// foo.=
cpp</div><div>(Foo foo) getFoo() {</div><div>=C2=A0 // foo is initialized a=
nd &quot;automatically returned&quot; unless another value is explicitly re=
turned</div><div>=C2=A0 foo.fizzle();</div><div>}</div><div><br></div><div>=
// Or maybe:</div><div>auto getFoo -&gt; Foo foo {</div><div>}</div><div><b=
r></div><div>-Michal</div></div><div><div><br><div class=3D"gmail_quote"><d=
iv dir=3D"ltr">On Tue, Sep 29, 2015 at 10:09 AM Nicol Bolas &lt;<a href=3D"=
mailto:jmckesson@gmail.com" target=3D"_blank">jmckesson@gmail.com</a>&gt; w=
rote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex=
;border-left:1px #ccc solid;padding-left:1ex">On Tuesday, September 29, 201=
5 at 2:28:58 AM UTC-4, Andrew Tomazos wrote:<blockquote class=3D"gmail_quot=
e" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-l=
eft:1ex"><div dir=3D"ltr"><div><div class=3D"gmail_quote"><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><span><blockquote class=3D"gmail_quote" style=3D"margin:0;mar=
gin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr=
"><br><div><div>=C2=A0 std::vector&lt;std::pair&lt;int,int&gt;&gt; build_po=
ints()=C2=A0{</div>=C2=A0 =C2=A0 while (c) return.emplace_back(g(c),h(c));<=
div>=C2=A0 }<br></div></div></div></blockquote></span><div></div></blockquo=
te></div></div></div></blockquote><br></blockquote></div></div></div></bloc=
kquote><div><br><br></div><div>And some languages allow you to use the func=
tion name:<br><br></div><div>Foo getFoo() {<br></div><div>=C2=A0=C2=A0 getF=
oo =3D lookup(...);<br>}<br><br></div><div><br></div><div>I don&#39;t like =
any of these suggestions (just aesthetically, they don&#39;t look/feel like=
 C++ to me) and don&#39;t think the committee should spend time on this are=
a - I don&#39;t think it is worth it.=C2=A0 Committee time is finite, and e=
xpensive.=C2=A0 There are better things to spend it on. IMO.<br></div><div>=
(and feel free to say the same of my proposals, if that&#39;s your opinion)=
<br><br></div><div>Tony<br>=C2=A0<br></div></div></div></div>

<p></p>

-- <br />
<br />
--- <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--089e013d0ffce685090520e8a4c9--

.
