220 29535 <108e091f-526e-47b9-b8c9-3c77452a965d@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Marc <marc.glisse@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: decltype(return)
Date: Thu, 24 Nov 2016 14:26:14 -0800 (PST)
Lines: 76
Approved: news@gmane.org
Message-ID: <108e091f-526e-47b9-b8c9-3c77452a965d@isocpp.org>
References: <658f00ff-7a02-7c04-3fcb-6ac7f45b777b@scylladb.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_8086_1923413685.1480026374631"
X-Trace: blaine.gmane.org 1480026378 16097 195.159.176.226 (24 Nov 2016 22:26:18 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 24 Nov 2016 22:26:18 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCGJRE7HX4IBBB6S3XAQKGQEU27FOUY@isocpp.org Thu Nov 24 23:26:13 2016
Return-path: <std-proposals+bncBCGJRE7HX4IBBB6S3XAQKGQEU27FOUY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pg0-f70.google.com ([74.125.83.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCGJRE7HX4IBBB6S3XAQKGQEU27FOUY@isocpp.org>)
	id 1cA2T6-0003Aa-M1
	for gclcip-std-proposals@m.gmane.org; Thu, 24 Nov 2016 23:26:12 +0100
Original-Received: by mail-pg0-f70.google.com with SMTP id g186sf132219356pgc.2
        for <gclcip-std-proposals@m.gmane.org>; Thu, 24 Nov 2016 14:26:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to: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=QevP10DRF/RRg9pFCgBLbCAmxRvQBXb4gIKXiduAEd8=;
        b=ftSYreM8mnczYAQ7jchjWwmQZpoLbIoL3nlSU4uGycVG9v2MLyKljCgZb34VY2dMAZ
         a15bQrHYvlMqmjMEevRMDIpC5OjlgYCZ8E9XgiXgfduG70+XcHSMGpDRSSscue9BmrX9
         ZSA34TqDV1VJZk9LHBe8tL7nsG5VvqfcETSFK26duhRODDzKuD+Wts9qJSIGHVAqfr4b
         FhHLdbPEv+xKwM8lCK0Je/wdlmXn9RMg0Jkq0CH8VGsdzkWknjP7JEc2TZCjwDhPon2F
         6xN3+QpSW+wfofuP/imjR3WLUKx0Gh6hR4u1FudlLgQvmVIVFJ3saCSWHc1ci+R6T63T
         R3tw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to: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=QevP10DRF/RRg9pFCgBLbCAmxRvQBXb4gIKXiduAEd8=;
        b=xOPwH6KN/D8P73Ivwf5iRPgjtU7CzB7BsIQXfxGdWJ4LD7uFFKN9v/3FUzj+gnXiyf
         rY7H9jDMkMK/bNlJ6n2Xg4Uxnxqpl2O4V6+qUeYXTnQrcBPSLle7+2FPCg7YZI7kCLTZ
         5f/MkPW9xN/nYeAQRAw1utMgXaD5ey9z5RNwtCVq/Ynz2ze4EkGoPKOb+2kjL1xXHvjb
         auC1gbavcJIKEPEMm0EF/3N30NLf5YEcfJGlJucD8q7koEegfcGxPE0uvk1/FHr7jrtY
         IV/5f6MrReRxN0OYBCS0BWD7gKNIOrUxid8+2VZ/zHI3MZRD7XQuWwxByFqvg3yA+Ibg
         6+NQ==
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: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=QevP10DRF/RRg9pFCgBLbCAmxRvQBXb4gIKXiduAEd8=;
        b=ldX9QdPwv+oE79R8L038EzmsKGuZva83I3cY/1YFZDvl1blzF/Hs+QSyCLO128JEQb
         N0CyGUxtJCq+ii+9IKuSItm/a3SEwmPUgg4lFNUmRZ435QG8TZnYb80tofVAdk5TgJy4
         oeIHOfAaWrQA8Qb3yfhAj+yXwTMVNRBr2aCsA1Jdz/6cZxI/KTmaWjVcR0unLumJgdof
         AtpZeZdPDVCglu5vN5yVnHDAS4+W9gsfZ3vITe1HrLLdDdr3csOvUhC/2WPgPwFLQ0LD
         IXTvcIvK9paTq8uS9bElttkbTIu3T8tAfOSMxH/xGPida+icuYNSEdKUf3f4phwtNAEN
         WBMA==
X-Gm-Message-State: AKaTC01WxIM0Hmf+A1naLUjoT0GwVVddywjwApTWDYvm3amqq4xy9wUCmbSa4CMifIg3mg==
X-Received: by 10.99.7.194 with SMTP id 185mr1994476pgh.6.1480026375947;
        Thu, 24 Nov 2016 14:26:15 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.26.102 with SMTP id u35ls4266040otu.4.gmail; Thu, 24 Nov
 2016 14:26:15 -0800 (PST)
X-Received: by 10.157.44.172 with SMTP id p41mr133658otb.6.1480026375051;
        Thu, 24 Nov 2016 14:26:15 -0800 (PST)
In-Reply-To: <658f00ff-7a02-7c04-3fcb-6ac7f45b777b@scylladb.com>
X-Original-Sender: marc.glisse@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:29535
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29535>

------=_Part_8086_1923413685.1480026374631
Content-Type: multipart/alternative; 
	boundary="----=_Part_8087_1327853358.1480026374631"

------=_Part_8087_1327853358.1480026374631
Content-Type: text/plain; charset=UTF-8

On Friday, November 18, 2016 at 5:01:41 PM UTC+1, Avi Kivity wrote:
>
>
> map<foo, map<set<bar>, baz> 
> complicated(...) { 
>      decltype(return) ret; 
>      // add stuff to ret 
>      return try; 
> } 
>
> Instead of repeating the complicated type, refer to it via 
> decltype(return).  Won't work with deduced return types, of course.
>

This has been suggested informally several times already, but afaik nobody 
did the work to write a paper and present it.
For instance:
https://groups.google.com/a/isocpp.org/d/topic/std-proposals/wdX31-nWSnc/discussion
(it also appears in the discussions about allowing explicit constructors in 
return statements)

-- 
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/108e091f-526e-47b9-b8c9-3c77452a965d%40isocpp.org.

------=_Part_8087_1327853358.1480026374631
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Friday, November 18, 2016 at 5:01:41 PM UTC+1, Avi Kivi=
ty wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: =
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
<br>map&lt;foo, map&lt;set&lt;bar&gt;, baz&gt;
<br>complicated(...) {
<br>=C2=A0 =C2=A0 =C2=A0decltype(return) ret;
<br>=C2=A0 =C2=A0 =C2=A0// add stuff to ret
<br>=C2=A0 =C2=A0 =C2=A0return try;
<br>}
<br>
<br>Instead of repeating the complicated type, refer to it via=20
<br>decltype(return). =C2=A0Won&#39;t work with deduced return types, of co=
urse.<br></blockquote><div><br>This has been suggested informally several t=
imes already, but afaik nobody did the work to write a paper and present it=
..<br>For instance:<br>https://groups.google.com/a/isocpp.org/d/topic/std-pr=
oposals/wdX31-nWSnc/discussion<br>(it also appears in the discussions about=
 allowing explicit constructors in return statements)<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/108e091f-526e-47b9-b8c9-3c77452a965d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/108e091f-526e-47b9-b8c9-3c77452a965d=
%40isocpp.org</a>.<br />

------=_Part_8087_1327853358.1480026374631--

------=_Part_8086_1923413685.1480026374631--

.
