220 20972 <489434f4-b703-4b0a-ad28-833899af1e14@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: auto return
Date: Tue, 29 Sep 2015 07:09:02 -0700 (PDT)
Lines: 359
Approved: news@gmane.org
Message-ID: <489434f4-b703-4b0a-ad28-833899af1e14@isocpp.org>
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>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_474_163516446.1443535743058"
X-Trace: ger.gmane.org 1443535753 22098 80.91.229.3 (29 Sep 2015 14:09:13 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 29 Sep 2015 14:09:13 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBAFXVKYAKGQERK3ZZ2A@isocpp.org Tue Sep 29 16:09:07 2015
Return-path: <std-proposals+bncBCEKFTV6ZUMBBAFXVKYAKGQERK3ZZ2A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yk0-f197.google.com ([209.85.160.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBAFXVKYAKGQERK3ZZ2A@isocpp.org>)
	id 1Zgvac-0001mt-IU
	for gclcip-std-proposals@m.gmane.org; Tue, 29 Sep 2015 16:09:06 +0200
Original-Received: by ykdg206 with SMTP id g206sf8828838ykd.1
        for <gclcip-std-proposals@m.gmane.org>; Tue, 29 Sep 2015 07:09:05 -0700 (PDT)
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
         :content-type: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=ozYAzZ39aG99bPKQ37HaEKDD4Z0ynCYlPd9yhBx33Q4=;
        b=ok1bx+Am8CkgT6erwb2ZCuwvxok2dj8t7nNtS7mzYa+H3MzyfmbghUAthCobSMkDHs
         mC4V4J/mIxK35x3O3ATgwd+MjbLPFzHcbcx185SKFO+IHmH8+oNS9DPS5Vn4B4KjtJ93
         nULlHXmnlYgNesBEPTpf766Hlir5siarGEJ5elmSMEvihbAN9pKOmD1bfkIIhRjZb2T1
         nbiDcHGy0o+53ZwSq3XtZ7MiCZlewafrsqwwxmhpRcIlPzGvSGp6cwoEpvDpkp7auKON
         nl+/kgoHKvSI1GY/RBd3Solp1Qa1tb+V6/vUNs90sNQjQ8T5/MMBs8POPLNzlmTjVOlI
         zXCA==
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:content-type: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=ozYAzZ39aG99bPKQ37HaEKDD4Z0ynCYlPd9yhBx33Q4=;
        b=L7TuYQSFDiH4o5nxp2pnNFUTbTauqgkFUp+ndC0kWYLOCB4Gh94Q8+YIqJyg06c4Wh
         yvRvRqTgLb+AAkwDDnRBkNEFrhOiS6+af3TGRO59igO7jTFZJYHSoX19Tz2MjukvYVft
         e3AOdHM1XX0ePKCUCaMJcEp25r4FIlqNQsr6WUlRfhbC3i1d2T2yMXtEtKE74GX9O0H0
         t6dCts6t2ZIjCb+mKCWPE3ImXfGq2XwALYqV26I7N4q/1S2ltzZit2CSh0wZaLTTgYOA
         2C0mqF1VkhlQV8HKpeEcNhrRbRzgXFfQ+1JZWu2X8QtIK/QSGVZcQofpMLGk7AWcnt0D
         Gwkg==
X-Gm-Message-State: ALoCoQkLTfsfeJD9QY/Vf4wpc3AtXDu68ls0/l5gRqkPL/az3z10PYZ4LqmpvJOI0qabHSY1SpkA
X-Received: by 10.140.165.83 with SMTP id l80mr23388549qhl.14.1443535745228;
        Tue, 29 Sep 2015 07:09:05 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.25.137 with SMTP id 131ls1987406ioz.45.gmail; Tue, 29 Sep
 2015 07:09:03 -0700 (PDT)
X-Received: by 10.50.62.107 with SMTP id x11mr5123igr.13.1443535743978;
        Tue, 29 Sep 2015 07:09:03 -0700 (PDT)
In-Reply-To: <CAB+4KHJ-8aY9AF6fOzi6ZUv1=Mfqe-9BVKe6Ou+X_KXQk_zM3g@mail.gmail.com>
X-Original-Sender: jmckesson@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:20972
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/20972>

------=_Part_474_163516446.1443535743058
Content-Type: multipart/alternative; 
	boundary="----=_Part_475_1419177943.1443535743058"

------=_Part_475_1419177943.1443535743058
Content-Type: text/plain; charset=UTF-8

On Tuesday, September 29, 2015 at 2:28:58 AM UTC-4, Andrew Tomazos wrote:
>
> Thanks for your feedback.  Questions answered below..
>
> On Tuesday, September 29, 2015 at 12:10:18 AM UTC-4, Andrew Tomazos wrote:On 
>> Tue, Sep 29, 2015 at 7:27 AM, Nicol Bolas <jmck...@gmail.com 
>> <javascript:>> wrote:
>>
> Now suppose we said that this variable could be unnamed, and in such cases 
>>> the keyword return could be used as an id-expression to refer to this 
>>> return value:
>>>
>>>   std::vector<std::pair<int,int>> build_points() {
>>>     auto return;
>>>     while (c) return.emplace_back(g(c),h(c));
>>>   }
>>>
>>
>> Why would you *want* an unnamed variable? Is typing a variable name 
>> somehow complicated? Is it an onerous burden for the user? Even in the 
>> context of implicit return, using the variable name rather than `return` 
>> makes far more sense.
>>
>  
> There are a number of places in the language where an unnamed entity is 
> defined, used or deduced.  I guess the motivation is the same as for those.
>

For values, yes this is true. However, those values are always (as far as I 
recall) *temporaries* that do not outlive the line in which they are 
generated. You're talking about deliberately declaring an unnamed *variable*
..

That's very new for C++.

Equally importantly, it's really confusing the issue. Are you saying that 
>> `return.blah` is an expression or is it a return statement that evaluates 
>> and returns an expression? Because the use of the word `return` strongly 
>> suggests the latter, not the former.
>>
>  
> If you're saying that there is some visual ambiguity, then that may be so.
>

Yes, I was talking about user confusion. But parsing ambiguities don't help 
your case.

As for parsing ambiguity, return.blah is not one. return.blah is 
> unambiguously an expression.  The LHS is the id-expression refering to the 
> auto return object.
>

Let's say we use your suggested parsing rule of "if it can be a return 
statement, it is a return statement".

So let's consider `return 5;`. That's a return statement. But did you *mean* 
for it to be a return statement? Or did you mean `return = 5` and you 
accidentally typed the wrong thing? If your return type is implicitly 
convertible from an integer, the compiler will accept either one. And the 
two mean very different things, with `return 5` immediately halting 
execution.

That is a very nasty, completely *silent* breakage. That's bad.

FYI: rules like the one you suggest gave us the Most Vexing Parse 
<https://en.wikipedia.org/wiki/Most_vexing_parse>. We should not 
deliberately add features like that again.

If you had just introduced an actual name, that wouldn't be necessary.

There are some parsing ambiguities like:
>
>    return(x);
>
> Is this an expression statement calling operator() of the return object, 
> or a return statement returning x.  These ambiguities would have to be 
> resolved as part of the proposal (most likely "if it can be a return 
> statement, it is a return statement").
>

Which would limit the ways in which you can use this implicit variable. You 
can't even call operator() on it without shenanigans (like `(return)()` or 
whatever). Though at least that may well be a noisy breakage.
 

> Is it default initialized or value initialized.
>>
>
> It is as-if it was declared without an initializer:
>
>   T f() {
>     T x;  // <-- like this
>  
> I can't remember which this implies off the top of my head.
>

That's default initialization 
<http://en.cppreference.com/w/cpp/language/default_initialization>, so for 
many types, they go uninitialized. That's generally considered bad these 
days. Or at least, it's not good for it to be the default case.

What if the type doesn't have a default constructor,
>>
>
> Ill-formed.
>
 
>
or if I want to call a different constructor? 
>>
>
> With the third implicit form, you can't.
>

Doesn't this restriction significantly limit how much users can use this 
"common pattern"? Even if only 30% of uses of this pattern used a 
non-default constructor, that's still almost 1/3rd of potential users who 
can't use this feature.

So ultimately, all they save is a return at the bottom of the function. 
Again, is that *one line* worth the syntactic burden?
 

> What if the default constructor throws; how would you catch the exception?
>>
>
> I can't remember if this works:
>
>     void f() {
>       return++;
>     } catch (...) {
>     }
>
> But if it does, it would catch an exception thrown from the return 
> constructor.
>

Well, that particular syntax doesn't work. But it is possible to create function-level 
try/catch blocks 
<http://en.cppreference.com/w/cpp/language/function-try-block>.

But really, you shouldn't encourage that.
 

> And most importantly, why is this at all worthwhile? Seriously, is 
>> declaring a variable and returning it really that hard?
>>
>  
> The motivation is mainly providing a terser syntax for an, in my opinion, 
> common pattern (as an example, a similar motivation to, although much 
> smaller than, lambdas).
>

You're saving 2 lines of code. In a function that's just 10 lines long 
(including declaration and {}s), that's only a 20% reduction in code size. 
And the shorter said code is, the *less* likely it is that you will need to 
use this pattern.

And you can only save two lines of code if you use the 
default-construct-followed-by-initialization pattern. If you need to use an 
actual constructor, you save... one line of code. Only 10% in a 10 line 
function.

If a full quarter of your functions use the first pattern (and I rather 
doubt it's even that common), you will save maybe 5% of actual lines of 
text.

So even if this pattern were common, you ultimately don't save much. And 
the downsides of the feature make  it harder to reason about code (thanks 
to `return` ambiguities), introduce unnamed variables, and make functions 
behave in a way that is very new (automatically returning values).

Lambdas save you tons of very difficult-to-write code, especially if they 
capture values. Thus far, your feature saves you 2 lines of 
trivial-to-write code.

So I'm failing to see the cost/benefit here.

-- 

--- 
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/.

------=_Part_475_1419177943.1443535743058
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Tuesday, September 29, 2015 at 2:28:58 AM UTC-4, Andrew Tomazos wrote:<b=
lockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;borde=
r-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">Thanks for your=
 feedback.=C2=A0 Questions answered below..<br><div><br><div class=3D"gmail=
_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border=
-left:1px #ccc solid;padding-left:1ex"><span>On Tuesday, September 29, 2015=
 at 12:10:18 AM UTC-4, Andrew Tomazos wrote:</span>On Tue, Sep 29, 2015 at =
7:27 AM, Nicol Bolas <span dir=3D"ltr">&lt;<a href=3D"javascript:" target=
=3D"_blank" gdf-obfuscated-mailto=3D"yTE7HNbjCQAJ" rel=3D"nofollow" onmouse=
down=3D"this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.hre=
f=3D&#39;javascript:&#39;;return true;">jmck...@gmail.com</a>&gt;</span> wr=
ote:<br></blockquote><div></div><blockquote class=3D"gmail_quote" style=3D"=
margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div></div><=
span><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;=
border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div></div><d=
iv></div><div>Now suppose we said that this variable could be unnamed, and =
in such cases the keyword return could be used as an id-expression to refer=
 to this return value:</div><div><br></div><div><div>=C2=A0 std::vector&lt;=
std::pair&lt;int,int&gt;<wbr>&gt; build_points()=C2=A0{</div><div>=C2=A0 =
=C2=A0 auto return;</div><div>=C2=A0 =C2=A0 while (c) return.emplace_back(g=
(c),h(c))<wbr>;</div><div>=C2=A0 }<br></div></div></div></blockquote></span=
><div><br>Why would you <i>want</i> an unnamed variable? Is typing a variab=
le name somehow complicated? Is it an onerous burden for the user? Even in =
the context of implicit return, using the variable name rather than `return=
` makes far more sense.<br></div></blockquote><div>=C2=A0</div><div>There a=
re a number of places in the language where an unnamed entity is defined, u=
sed or deduced.=C2=A0 I guess the motivation is the same as for those.</div=
></div></div></div></blockquote><div><br>For values, yes this is true. Howe=
ver, those values are always (as far as I recall) <i>temporaries</i> that d=
o not outlive the line in which they are generated. You&#39;re talking abou=
t deliberately declaring an unnamed <i>variable</i>.<br><br>That&#39;s very=
 new for C++.<br><br></div><blockquote class=3D"gmail_quote" style=3D"margi=
n: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><di=
v dir=3D"ltr"><div><div class=3D"gmail_quote"><div></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><div>Equally importantly, it&#39;s really confusing the issue=
.. Are you saying that `return.blah` is an expression or is it a return stat=
ement that evaluates and returns an expression? Because the use of the word=
 `return` strongly suggests the latter, not the former.<br></div></blockquo=
te><div>=C2=A0</div><div>If you&#39;re saying that there is some visual amb=
iguity, then that may be so.</div></div></div></div></blockquote><div><br>Y=
es, I was talking about user confusion. But parsing ambiguities don&#39;t h=
elp your case.<br><br></div><blockquote class=3D"gmail_quote" style=3D"marg=
in: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><d=
iv dir=3D"ltr"><div><div class=3D"gmail_quote"><div></div><div>As for parsi=
ng ambiguity, return.blah is not one. return.blah is unambiguously an expre=
ssion.=C2=A0 The LHS is the id-expression refering to the auto return objec=
t.</div></div></div></div></blockquote><div><br>Let&#39;s say we use your s=
uggested parsing rule of &quot;if it can be a return statement, it is a ret=
urn statement&quot;.<br><br>So let&#39;s consider `return 5;`. That&#39;s a=
 return statement. But did you <i>mean</i> for it to be a return statement?=
 Or did you mean `return =3D 5` and you accidentally typed the wrong thing?=
 If your return type is implicitly convertible from an integer, the compile=
r will accept either one. And the two mean very different things, with `ret=
urn 5` immediately halting execution.<br><br>That is a very nasty, complete=
ly <i>silent</i> breakage. That&#39;s bad.<br><br>FYI: rules like the one y=
ou suggest gave us the <a href=3D"https://en.wikipedia.org/wiki/Most_vexing=
_parse">Most Vexing Parse</a>. We should not deliberately add features like=
 that again.<br><br>If you had just introduced an actual name, that wouldn&=
#39;t be necessary.<br><br></div><blockquote class=3D"gmail_quote" style=3D=
"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex=
;"><div dir=3D"ltr"><div><div class=3D"gmail_quote"><div></div><div>There a=
re some parsing ambiguities like:</div><div><br></div><div>=C2=A0 =C2=A0ret=
urn(x);</div><div><br></div><div>Is this an expression statement calling op=
erator() of the return object, or a return statement returning x.=C2=A0 The=
se ambiguities would have to be resolved as part of the proposal (most like=
ly &quot;if it can be a return statement, it is a return statement&quot;).<=
/div></div></div></div></blockquote><div><br>Which would limit the ways in =
which you can use this implicit variable. You can&#39;t even call operator(=
) on it without shenanigans (like `(return)()` or whatever). Though at leas=
t that may well be a noisy breakage.<br>=C2=A0</div><blockquote class=3D"gm=
ail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc soli=
d;padding-left: 1ex;"><div dir=3D"ltr"><div><div class=3D"gmail_quote"><div=
></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-=
left:1px #ccc solid;padding-left:1ex"><div>Is it default initialized or val=
ue initialized.</div></blockquote><div><br></div><div>It is as-if it was de=
clared without an initializer:</div><div><br></div><div>=C2=A0 T f() {</div=
><div>=C2=A0 =C2=A0 T x; =C2=A0// &lt;-- like this</div><div>=C2=A0</div><d=
iv>I can&#39;t remember which this implies off the top of my head.</div></d=
iv></div></div></blockquote><div><br>That&#39;s <a href=3D"http://en.cppref=
erence.com/w/cpp/language/default_initialization">default initialization</a=
>, so for many types, they go uninitialized. That&#39;s generally considere=
d bad these days. Or at least, it&#39;s not good for it to be the default c=
ase.<br><br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"=
ltr"><div><div class=3D"gmail_quote"><div></div><blockquote class=3D"gmail_=
quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1=
ex"><div> What if the type doesn&#39;t have a default constructor,</div></b=
lockquote><div><br></div><div>Ill-formed.</div></div></div></div></blockquo=
te><blockquote style=3D"margin: 0px 0px 0px 0.8ex; border-left: 1px solid r=
gb(204, 204, 204); padding-left: 1ex;" class=3D"gmail_quote"><div>=C2=A0</d=
iv></blockquote><div></div><blockquote class=3D"gmail_quote" style=3D"margi=
n: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><di=
v dir=3D"ltr"><div><div class=3D"gmail_quote"><div></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><div> or if I want to call a different constructor? </div></b=
lockquote><div><br></div><div>With the third implicit form, you can&#39;t.<=
/div></div></div></div></blockquote><div><br>Doesn&#39;t this restriction s=
ignificantly limit how much users can use this &quot;common pattern&quot;? =
Even if only 30% of uses of this pattern used a non-default constructor, th=
at&#39;s still almost 1/3rd of potential users who can&#39;t use this featu=
re.<br><br>So ultimately, all they save is a return at the bottom of the fu=
nction. Again, is that <i>one line</i> worth the syntactic burden?<br>=C2=
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: =
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div=
><div class=3D"gmail_quote"><div></div><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>=
What if the default constructor throws; how would you catch the exception?<=
br></div></blockquote><div><br></div><div>I can&#39;t remember if this work=
s:</div><div><br></div><div>=C2=A0 =C2=A0 void f() {</div><div>=C2=A0 =C2=
=A0 =C2=A0 return++;</div><div>=C2=A0 =C2=A0 } catch (...) {</div><div>=C2=
=A0 =C2=A0 }</div><div><br></div><div>But if it does, it would catch an exc=
eption thrown from the return constructor.</div></div></div></div></blockqu=
ote><div><br>Well, that particular syntax doesn&#39;t work. But it is possi=
ble to create <a href=3D"http://en.cppreference.com/w/cpp/language/function=
-try-block">function-level try/catch blocks</a>.<br><br>But really, you sho=
uldn&#39;t encourage that.<br>=C2=A0</div><blockquote class=3D"gmail_quote"=
 style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-=
left: 1ex;"><div dir=3D"ltr"><div><div class=3D"gmail_quote"><div></div><di=
v></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border=
-left:1px #ccc solid;padding-left:1ex"><div>And most importantly, why is th=
is at all worthwhile? Seriously, is declaring a variable and returning it r=
eally that hard?<br></div></blockquote><div>=C2=A0</div><div>The motivation=
 is mainly providing a terser syntax for an, in my opinion, common pattern =
(as an example, a similar motivation to, although much smaller than, lambda=
s).</div></div></div></div></blockquote><div><br>You&#39;re saving 2 lines =
of code. In a function that&#39;s just 10 lines long (including declaration=
 and {}s), that&#39;s only a 20% reduction in code size. And the shorter sa=
id code is, the <i>less</i> likely it is that you will need to use this pat=
tern.<br><br>And you can only save two lines of code if you use the default=
-construct-followed-by-initialization pattern. If you need to use an actual=
 constructor, you save... one line of code. Only 10% in a 10 line function.=
<br><br>If a full quarter of your functions use the first pattern (and I ra=
ther doubt it&#39;s even that common), you will save maybe 5% of actual lin=
es of text.<br><br>So even if this pattern were common, you ultimately don&=
#39;t save much. And the downsides of the feature make=C2=A0 it harder to r=
eason about code (thanks to `return` ambiguities), introduce unnamed variab=
les, and make functions behave in a way that is very new (automatically ret=
urning values).<br><br>Lambdas save you tons of very difficult-to-write cod=
e, especially if they capture values. Thus far, your feature saves you 2 li=
nes of trivial-to-write code.<br><br>So I&#39;m failing to see the cost/ben=
efit here.<br></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 />

------=_Part_475_1419177943.1443535743058--
------=_Part_474_163516446.1443535743058--

.
