220 21647 <CA4AD0AE-C528-47CB-A76D-AA2A94D52E4E@gmail.com> article
Path: news.gmane.org!not-for-mail
From: David Krauss <potswa@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Introducing the returntype keyword
Date: Tue, 13 Oct 2015 17:23:42 +0800
Lines: 95
Approved: news@gmane.org
Message-ID: <CA4AD0AE-C528-47CB-A76D-AA2A94D52E4E@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>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
Content-Type: multipart/alternative; boundary="Apple-Mail=_5C936C5C-D7C5-4ADA-9ECB-7DD61A07ED9B"
X-Trace: ger.gmane.org 1444728260 7748 80.91.229.3 (13 Oct 2015 09:24:20 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 13 Oct 2015 09:24:20 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCW25A7E3QCRBMU36OYAKGQETTXYDHQ@isocpp.org Tue Oct 13 11:24:15 2015
Return-path: <std-proposals+bncBCW25A7E3QCRBMU36OYAKGQETTXYDHQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qg0-f70.google.com ([209.85.192.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCW25A7E3QCRBMU36OYAKGQETTXYDHQ@isocpp.org>)
	id 1Zlvoc-00077d-JB
	for gclcip-std-proposals@m.gmane.org; Tue, 13 Oct 2015 11:24:14 +0200
Original-Received: by qgez77 with SMTP id z77sf13133098qge.2
        for <gclcip-std-proposals@m.gmane.org>; Tue, 13 Oct 2015 02:24:04 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:content-type:message-id:mime-version
         :subject:date:references:to:in-reply-to: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=JG8Pc6RTvcrDhh255NlXkX6usaiilW4KSvlx9RtSbPw=;
        b=g8x2c0UBgHs6O8/IsJG5ASuu2ZTqTmKwCZ3vuiDR4EGy3ICBuQT1QPkEyh2BeJjO15
         2I05bQ39QLWSy2RbAlwOhCm7lb0ptXPp1F5kcQShvoF1078oZ4WK1NW13Ni5M7b50jnC
         Kego4g0edvzsYJXTRGl9SLM4CURx0MijA4dSrt0cUXde/eJ+9IEX8q/BjhGsFHlRmu6Z
         riZXUKIyBhGOzQFUwyBne97bB9cWBn8hVZ1ooXvGRzxwOF18Bju6JXTnGL7cxD3k687y
         qsfD3o08gHANKzslsY0ES2ox4F/kW5x+pYB1lvrrJiw1ZnvQvRiKN8q1cxR/+gnyhLQr
         CXsQ==
X-Gm-Message-State: ALoCoQnQ7Cy7A4oNNwFLna3AFJQJpIj13NNVuqCXx0bYbnU39emzWDFY18rHC75YMwhN3f33tjFa
X-Received: by 10.129.103.4 with SMTP id b4mr27893603ywc.24.1444728244019;
        Tue, 13 Oct 2015 02:24:04 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.137.140 with SMTP id t12ls1665879ioi.34.gmail; Tue, 13 Oct
 2015 02:24:02 -0700 (PDT)
X-Received: by 10.107.129.218 with SMTP id l87mr7824518ioi.181.1444728242850;
        Tue, 13 Oct 2015 02:24:02 -0700 (PDT)
Original-Received: from mail-pa0-x22d.google.com (mail-pa0-x22d.google.com. [2607:f8b0:400e:c03::22d])
        by mx.google.com with ESMTPS id m194si2051557iom.139.2015.10.13.02.24.02
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 13 Oct 2015 02:24:02 -0700 (PDT)
Received-SPF: pass (google.com: domain of potswa@gmail.com designates 2607:f8b0:400e:c03::22d as permitted sender) client-ip=2607:f8b0:400e:c03::22d;
Original-Received: by pacex6 with SMTP id ex6so16137792pac.3
        for <std-proposals@isocpp.org>; Tue, 13 Oct 2015 02:24:02 -0700 (PDT)
X-Received: by 10.66.100.165 with SMTP id ez5mr39004084pab.63.1444728242373;
        Tue, 13 Oct 2015 02:24:02 -0700 (PDT)
Original-Received: from [172.20.10.2] ([121.54.44.92])
        by smtp.gmail.com with ESMTPSA id d13sm2684679pbu.20.2015.10.13.02.23.47
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 13 Oct 2015 02:24:01 -0700 (PDT)
In-Reply-To: <3374ec49-e50e-40dc-8936-46e642a93ebf@isocpp.org>
X-Mailer: Apple Mail (2.2104)
X-Original-Sender: potswa@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of potswa@gmail.com designates 2607:f8b0:400e:c03::22d as permitted
 sender) smtp.mailfrom=potswa@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:21647
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/21647>

--Apple-Mail=_5C936C5C-D7C5-4ADA-9ECB-7DD61A07ED9B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 2015=E2=80=9310=E2=80=9313, at 5:08 PM, Klemens Morgenstern <klemens.m=
orgenstern@gmx.net> wrote:
>=20
> decltype(return) some_value;
> return &some_value;

What=E2=80=99s the problem? There=E2=80=99s already a diagnosable rule for =
mismatched return expressions in a deduced function.

> Now this is obviously utter nonsense, but a situation were the return typ=
e actually depends on the decltype(return) is rather likely with this sort =
of programming.


The error is easier to avoid, not easier to commit, if the deduced return t=
ype is available to the programmer.

--=20

---=20
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 e=
mail 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-proposa=
ls/.

--Apple-Mail=_5C936C5C-D7C5-4ADA-9ECB-7DD61A07ED9B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><br class=3D""><di=
v><blockquote type=3D"cite" class=3D""><div class=3D"">On 2015=E2=80=9310=
=E2=80=9313, at 5:08 PM, Klemens Morgenstern &lt;<a href=3D"mailto:klemens.=
morgenstern@gmx.net" class=3D"">klemens.morgenstern@gmx.net</a>&gt; wrote:<=
/div><br class=3D"Apple-interchange-newline"><div class=3D""><div style=3D"=
font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: =
normal; font-weight: normal; letter-spacing: normal; line-height: normal; o=
rphans: auto; text-align: start; text-indent: 0px; text-transform: none; wh=
ite-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-wid=
th: 0px;" class=3D""><div class=3D"prettyprint" style=3D"border: 1px solid =
rgb(187, 187, 187); word-wrap: break-word; background-color: rgb(250, 250, =
250);"><code class=3D"prettyprint"><span class=3D"styled-by-prettify" style=
=3D"color: rgb(0, 0, 136);">decltype</span><span class=3D"styled-by-prettif=
y" style=3D"color: rgb(102, 102, 0);">(</span><span class=3D"styled-by-pret=
tify" style=3D"color: rgb(0, 0, 136);">return</span><span class=3D"styled-b=
y-prettify" style=3D"color: rgb(102, 102, 0);">)</span><span class=3D"Apple=
-converted-space">&nbsp;</span>some_value<span class=3D"styled-by-prettify"=
 style=3D"color: rgb(102, 102, 0);">;</span><br class=3D""><span class=3D"s=
tyled-by-prettify" style=3D"color: rgb(0, 0, 136);">return</span>&nbsp;<spa=
n class=3D"styled-by-prettify" style=3D"color: rgb(102, 102, 0);">&amp;</sp=
an>some_value<span class=3D"styled-by-prettify" style=3D"color: rgb(102, 10=
2, 0);">;</span><font color=3D"#666600" class=3D""></font></code></div><div=
 class=3D""></div></div></div></blockquote><div><br class=3D""></div><div c=
lass=3D"">What=E2=80=99s the problem? There=E2=80=99s already a diagnosable=
 rule for mismatched return expressions in a deduced function.</div><div cl=
ass=3D""><br class=3D""></div><blockquote type=3D"cite" class=3D""><div cla=
ss=3D""><div style=3D"font-family: Helvetica; font-size: 12px; font-style: =
normal; font-variant: normal; font-weight: normal; letter-spacing: normal; =
line-height: normal; orphans: auto; text-align: start; text-indent: 0px; te=
xt-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -=
webkit-text-stroke-width: 0px;" class=3D"">Now this is obviously utter nons=
ense, but a situation were the return type actually depends on the decltype=
(return) is rather likely with this sort of programming.</div></div></block=
quote></div><div class=3D""><br class=3D""></div><div class=3D"">The error =
is easier to <i class=3D"">avoid</i>, not easier to commit, if the deduced =
return type is available to the programmer.</div><div class=3D""><br class=
=3D""></div></body></html>

<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 />

--Apple-Mail=_5C936C5C-D7C5-4ADA-9ECB-7DD61A07ED9B--

.
