220 21754 <CAHK+-Ft749bbR-MKK64VTF3OXmrEAHe-hOrD219Oo0WGpbJVkg@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Sam Kellett <samkellett@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Introducing the returntype keyword
Date: Wed, 14 Oct 2015 08:27:14 +0100
Lines: 115
Approved: news@gmane.org
Message-ID: <CAHK+-Ft749bbR-MKK64VTF3OXmrEAHe-hOrD219Oo0WGpbJVkg@mail.gmail.com>
References: <24e315aa-2daf-4e47-933b-1f45157a0f79@isocpp.org>
	<mtuvue$jl1$1@ger.gmane.org>
	<CAMeU-s3cCNJX7uynNYdkHAEq2AbE_fT+M_6cEkQ1h8KJJkJdMw@mail.gmail.com>
	<CAOU91OMTLdtAW+cN83ymE38cx6PG8N8riyFZiQ2iayh98ym4gg@mail.gmail.com>
	<CAOU91OOZt4VoFVu2_t+5BhGvbRbEM2aP=dPE+oSeqMSGgomm1w@mail.gmail.com>
	<0884ab8b-672b-459a-9143-f522ea7ebf1d@isocpp.org>
	<ECDB85D3-3B91-4C65-AD0F-2D8F05556C3B@gmail.com>
	<3374ec49-e50e-40dc-8936-46e642a93ebf@isocpp.org>
	<mvj400$b8c$1@ger.gmane.org>
	<cff4d86b-93ea-443d-919f-5bcbd1ffcf84@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a11c3bfeece019305220b7db9
X-Trace: ger.gmane.org 1444807641 2216 80.91.229.3 (14 Oct 2015 07:27:21 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 14 Oct 2015 07:27:21 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDY6DWXBQIPRBU4H7CYAKGQE22DXONY@isocpp.org Wed Oct 14 09:27:21 2015
Return-path: <std-proposals+bncBDY6DWXBQIPRBU4H7CYAKGQE22DXONY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lb0-f200.google.com ([209.85.217.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDY6DWXBQIPRBU4H7CYAKGQE22DXONY@isocpp.org>)
	id 1ZmGSy-0006Ad-Br
	for gclcip-std-proposals@m.gmane.org; Wed, 14 Oct 2015 09:27:16 +0200
Original-Received: by lbcao8 with SMTP id ao8sf20920583lbc.1
        for <gclcip-std-proposals@m.gmane.org>; Wed, 14 Oct 2015 00:27:15 -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=qrV+yYtXkqNkCE1kDzhQJNj2BZrJin3zKaACCuurEnU=;
        b=CKtdaZ/1i613DX4lOQYG2xER3GC/rshUFA60OWEvZpl8nswWzN7svN/s74w7Gxh3PW
         YXOYy2pguQPwmvLWLzZSfGvCKVdkoK6iU2Z+AB+Lvr3Y15Pu9aSOL4bj+Ly/x3/fBf3v
         gUMBAAm07+HpWaY6JLPfDpPkfSKSXhbJmI1JAdCGINjLzJQ1CmVGAVxAxDC+wr5vETKE
         nwCId5MbelkOmmqAXf+bVmIGIhZ51mK1K2ONoUoFISHyzoP+YXYdnfmPAdEF11m0kMoo
         Twbdvd9xvoqlTsNOG10jCXkBt1cbd9euuLdu3Yzm9bR7DZ3ODjLWmtJHRE+nUs3GVpoh
         hwDA==
X-Gm-Message-State: ALoCoQnbz2RNfXlLmm9F6pwsIP92gsMCKA2lxBJHV/ZBHy98yFu8Tmzk9VDB0Z+YJ3uTox4kV54O
X-Received: by 10.180.10.135 with SMTP id i7mr482680wib.2.1444807635894;
        Wed, 14 Oct 2015 00:27:15 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.25.32.207 with SMTP id g198ls5419lfg.18.gmail; Wed, 14 Oct
 2015 00:27:14 -0700 (PDT)
X-Received: by 10.112.154.9 with SMTP id vk9mr762347lbb.42.1444807634449;
        Wed, 14 Oct 2015 00:27:14 -0700 (PDT)
Original-Received: from mail-lb0-x22a.google.com (mail-lb0-x22a.google.com. [2a00:1450:4010:c04::22a])
        by mx.google.com with ESMTPS id h21si4685837lfb.104.2015.10.14.00.27.14
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 14 Oct 2015 00:27:14 -0700 (PDT)
Received-SPF: pass (google.com: domain of samkellett@gmail.com designates 2a00:1450:4010:c04::22a as permitted sender) client-ip=2a00:1450:4010:c04::22a;
Original-Received: by lbcao8 with SMTP id ao8so39778954lbc.3
        for <std-proposals@isocpp.org>; Wed, 14 Oct 2015 00:27:14 -0700 (PDT)
X-Received: by 10.112.17.105 with SMTP id n9mr775894lbd.78.1444807634188; Wed,
 14 Oct 2015 00:27:14 -0700 (PDT)
Original-Received: by 10.114.173.114 with HTTP; Wed, 14 Oct 2015 00:27:14 -0700 (PDT)
In-Reply-To: <cff4d86b-93ea-443d-919f-5bcbd1ffcf84@isocpp.org>
X-Original-Sender: samkellett@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of samkellett@gmail.com designates 2a00:1450:4010:c04::22a as
 permitted sender) smtp.mailfrom=samkellett@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:21754
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/21754>

--001a11c3bfeece019305220b7db9
Content-Type: text/plain; charset=UTF-8

On 14 October 2015 at 06:03, Klemens Morgenstern <
klemens.morgenstern@gmx.net> wrote:

> Basically, there are various reasons why repeating the function
>> signature is less than desirable.
>>
>
> Well I am doubting that this is convincing, however there might be
> situations where you need it for ambiguity reasons:
>
>
> double foo(const bar & f)
> {
>       return 34.1;
> }
>
>
> int foo(bar && b)
> {
>         decltype(foo(b)) x; //type == double, because b binds to const
> bar &  inside the function
>         decltype(return) y; //type == int
>         return 42;
> }
>
>
> But I can't really come up with a good example where this is needed. Maybe
> someone else has an idea.
>

what about when the return type is the result of some complex
metaprogramming calculation?

-- 

--- 
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/.

--001a11c3bfeece019305220b7db9
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 14 October 2015 at 06:03, Klemens Morgenstern <span dir=3D"ltr">&lt;=
<a href=3D"mailto:klemens.morgenstern@gmx.net" target=3D"_blank">klemens.mo=
rgenstern@gmx.net</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"><span class=3D""><blockquote class=3D"gmail_quote" style=3D=
"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">Ba=
sically, there are various reasons why repeating the function
<br>signature is less than desirable.
<br></blockquote><div><br></div></span><div>Well I am doubting that this is=
 convincing, however there might be situations where you need it for ambigu=
ity reasons:</div><div><br></div><div><br></div><div><div style=3D"border:1=
px solid rgb(187,187,187);word-wrap:break-word;background-color:rgb(250,250=
,250)"><code><div><span style=3D"color:#008">double</span><span style=3D"co=
lor:#000"> foo</span><span style=3D"color:#660">(</span><span style=3D"colo=
r:#008">const</span><span style=3D"color:#000"> bar </span><span style=3D"c=
olor:#660">&amp;</span><span style=3D"color:#000"> f</span><span style=3D"c=
olor:#660">)</span><span style=3D"color:#000"><br></span><span style=3D"col=
or:#660">{</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 =C2=A0 </span=
><span style=3D"color:#008">return</span><span style=3D"color:#000"> </span=
><span style=3D"color:#066">34.1</span><span style=3D"color:#660">;</span><=
span style=3D"color:#000"><br></span><span style=3D"color:#660">}</span><sp=
an style=3D"color:#000"><br><br><br></span><span style=3D"color:#008">int</=
span><span style=3D"color:#000"> foo</span><span style=3D"color:#660">(</sp=
an><span style=3D"color:#000">bar </span><span style=3D"color:#660">&amp;&a=
mp;</span><span style=3D"color:#000"> b</span><span style=3D"color:#660">)<=
/span><span style=3D"color:#000"><br></span><span style=3D"color:#660">{</s=
pan><span style=3D"color:#000"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span=
 style=3D"color:#008">decltype</span><span style=3D"color:#660">(</span><sp=
an style=3D"color:#000">foo</span><span style=3D"color:#660">(</span><span =
style=3D"color:#000">b</span><span style=3D"color:#660">))</span><span styl=
e=3D"color:#000"> x</span><span style=3D"color:#660">;</span><span style=3D=
"color:#000"> </span><span style=3D"color:#800">//type =3D=3D double, becau=
se b binds to const bar &amp; =C2=A0inside the function</span><span style=
=3D"color:#000"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color=
:#008">decltype</span><span style=3D"color:#660">(</span><span style=3D"col=
or:#008">return</span><span style=3D"color:#660">)</span><span style=3D"col=
or:#000"> y</span><span style=3D"color:#660">;</span><span style=3D"color:#=
000"> </span><span style=3D"color:#800">//type =3D=3D int</span><span style=
=3D"color:#000"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color=
:#008">return</span><span style=3D"color:#000"> </span><span style=3D"color=
:#066">42</span><span style=3D"color:#660">;</span><span style=3D"color:#00=
0"><br></span><span style=3D"color:#660">}</span></div></code></div><div st=
yle=3D"font-family:Arial,Helvetica,sans-serif;background-color:rgb(255,255,=
255)"><br></div><br>But I can&#39;t really come up with a good example wher=
e this is needed. Maybe someone else has an idea.</div></div></blockquote><=
div><br></div><div>what about when the return type is the result of some co=
mplex metaprogramming calculation? <br></div></div><br></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 />

--001a11c3bfeece019305220b7db9--

.
