220 1189 <39FEE49B-4EFE-4EA2-9C98-266012AC55D7@gmail.com> article
Path: news.gmane.org!not-for-mail
From: Daniel Biesiada <hollowonepl@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals,gmane.comp.lang.c++.isocpp.general
Subject: Re: [std-discussion] Re: An implementation of Generic
 lambdas (Request for feedback)
Date: Fri, 21 Dec 2012 14:02:13 +0100
Lines: 430
Approved: news@gmane.org
Message-ID: <39FEE49B-4EFE-4EA2-9C98-266012AC55D7@gmail.com>
References: <CABsSThq8V7_T8d37axi6fgQm_EbvfSMPqj5_Uj0sk00qVWPO6A@mail.gmail.com> <9dfac230-c5fb-4bc3-bde1-396a3f3a824c@isocpp.org> <daa02f6ff5514e7a94116571302de769@BN1PR03MB086.namprd03.prod.outlook.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
Content-Type: multipart/alternative; boundary="Apple-Mail=_5ED7E440-596B-4B1C-A70E-5FB5E8DDBFB5"
X-Trace: ger.gmane.org 1356094937 11088 80.91.229.3 (21 Dec 2012 13:02:17 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 21 Dec 2012 13:02:17 +0000 (UTC)
Cc: "std-proposals@isocpp.org" <std-proposals@isocpp.org>,
 "faisalv@gmail.com" <faisalv@gmail.com>
To: std-discussion@isocpp.org
Original-X-From: std-proposals+bncBCALZPFRRUPBBWN32GDAKGQETI2BTVI@isocpp.org Fri Dec 21 14:02:32 2012
Return-path: <std-proposals+bncBCALZPFRRUPBBWN32GDAKGQETI2BTVI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wg0-f69.google.com ([74.125.82.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCALZPFRRUPBBWN32GDAKGQETI2BTVI@isocpp.org>)
	id 1Tm2FD-0001Zn-7T
	for gclcip-std-proposals@m.gmane.org; Fri, 21 Dec 2012 14:02:31 +0100
Original-Received: by mail-wg0-f69.google.com with SMTP id es5sf3655161wgb.4
        for <gclcip-std-proposals@m.gmane.org>; Fri, 21 Dec 2012 05:02:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-received:x-beenthere:x-received:x-received:received-spf
         :x-received:mime-version:subject:from:in-reply-to:date:cc:message-id
         :references:to:x-mailer:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-google-group-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=dYuBc00wAFtK/1kb/ilZFUW2N0Cvs08Jg9b51IXp58w=;
        b=JBsZX56U5Zsfw2f3Cvj16WURZaVO3wD81aKJ3B/6pj/hUyh/GSt2kzV3S9/W4Eh3Bq
         0CymohbV/Epnpftb9s/QM2Yi9+z4tc+EhYT+AWE90IuQEqHT+YpHtqHjoFURn65+HMWv
         79x7d3rpYuaGGBPVJ2A8+MalfhwNHny92B9DTjvAZM0GYFbJDBzBfSH80YG0k7fmGfeL
         lUwdaHejnCWEdC7BI0IjYPhXX4nV3BJuFKBgYScfi0/3MAH3MNqydO70jx2LNUmwhmFv
         uyaNSVgK8OvthduYz7humoI1dNk0oa75ls7Pf 
X-Received: by 10.180.78.36 with SMTP id y4mr4160487wiw.1.1356094937382;
        Fri, 21 Dec 2012 05:02:17 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.88.73 with SMTP id be9ls1532008wib.21.gmail; Fri, 21 Dec
 2012 05:02:16 -0800 (PST)
X-Received: by 10.14.206.197 with SMTP id l45mr31987055eeo.17.1356094936894;
        Fri, 21 Dec 2012 05:02:16 -0800 (PST)
X-Received: by 10.14.206.197 with SMTP id l45mr31987046eeo.17.1356094936828;
        Fri, 21 Dec 2012 05:02:16 -0800 (PST)
Original-Received: from mail-ee0-f45.google.com (mail-ee0-f45.google.com [74.125.83.45])
        by mx.google.com with ESMTPS id j7si27901461eeo.66.2012.12.21.05.02.16
        (version=TLSv1/SSLv3 cipher=OTHER);
        Fri, 21 Dec 2012 05:02:16 -0800 (PST)
Received-SPF: pass (google.com: domain of hollowonepl@gmail.com designates 74.125.83.45 as permitted sender) client-ip=74.125.83.45;
Original-Received: by mail-ee0-f45.google.com with SMTP id d49so2331950eek.4
        for <multiple recipients>; Fri, 21 Dec 2012 05:02:16 -0800 (PST)
X-Received: by 10.14.203.8 with SMTP id e8mr32078365eeo.2.1356094936385;
        Fri, 21 Dec 2012 05:02:16 -0800 (PST)
Original-Received: from [192.168.25.188] ([213.17.171.18])
        by mx.google.com with ESMTPS id e2sm21527329eeo.8.2012.12.21.05.02.14
        (version=TLSv1/SSLv3 cipher=OTHER);
        Fri, 21 Dec 2012 05:02:15 -0800 (PST)
In-Reply-To: <daa02f6ff5514e7a94116571302de769@BN1PR03MB086.namprd03.prod.outlook.com>
X-Mailer: Apple Mail (2.1499)
X-Original-Sender: hollowonepl@gmail.com
X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain
 of hollowonepl@gmail.com designates 74.125.83.45 as permitted sender)
 smtp.mail=hollowonepl@gmail.com; dkim=pass header.i=@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: <http://groups.google.com/a/isocpp.org/group/std-proposals/post?hl=en>,
 <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?hl=en&topic=25838>,
 <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:1189 gmane.comp.lang.c++.isocpp.general:498
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/1189>

--Apple-Mail=_5ED7E440-596B-4B1C-A70E-5FB5E8DDBFB5
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=ISO-8859-2

Wow,

This is almost same crazy as Javascript's inside function scoping.=20
I'm terrified to think how people will use that in practice ;-)

-
Daniel Biesiada


Wiadomo=B6=E6 napisana przez Herb Sutter <hsutter@microsoft.com> w dniu 20 =
gru 2012, o godz. 21:09:

> Composition and currying are cool.
> =20
> Those who don't like the terse syntax may object that it's only slightly =
worse with the current syntax, though, right?
> =20
> auto compose =3D []( auto f, auto g ) { return
>     [=3D]( auto x ) f( g(x) ); };
> =20
> auto curry3 =3D
>    []( auto f ) { return
>        [=3D](auto x) { return [=3D](auto y) { return [=3D](auto z) { retu=
rn
>            f(x,y,z); }; }; }; };
> =20
> Though you do have to be a little careful to balance the {'s and };'s.
> =20
> Herb
> =20
> =20
> From: Scott Prager [mailto:splinterofchaos@gmail.com]=20
> Sent: Thursday, December 20, 2012 10:16 AM
> To: std-proposals@isocpp.org
> Cc: std-discussion@isocpp.org; faisalv@gmail.com
> Subject: [std-proposals] Re: An implementation of Generic lambdas (Reques=
t for feedback)
> =20
> Absolutely fantastic! A few things on interest:
>=20
> I had not realized this syntax supports nesting:
>=20
> auto compose =3D []( auto f, auto g )
>     [=3D]( auto x ) f( g(x) );
>=20
> auto curry3 =3D
>    []( auto f )
>        [=3D](auto x) [=3D](auto y) [=3D](auto z)=20
>            f(x,y,z);
>=20
> And variadic lambdas, too! Very nice.=20
> But I wonder why we couldn't...
> auto f =3D []( auto _f ) [](auto ...x) _f(x...);
>=20
> I wrote some tests. A few lines caused the compiler to crash so I comment=
ed them out and labelled them "Crash!".
>=20
> https://gist.github.com/4347130
>=20
>=20
> On Monday, December 17, 2012 2:05:37 PM UTC-5, faisalv wrote:
> Motivated by the positive feedback we received regarding Generic=20
> Lambdas (during the October 2012 ISO C++ Standards Meeting in=20
> Portland), I have implemented a reasonably complete (unless I am=20
> missing something obvious) implementation=20
> (http://faisalv.github.com/clang-glambda/) of most of the proposal=20
> (named lambda syntax for functions has not been attempted) using a=20
> fork of clang.=20
>=20
> We would like to encourage developers who are interested in this=20
> feature, to either compile the code or download the binaries (sorry,=20
> only windows for now) and play with the implementation and provide us=20
> with feedback so that we can incorporate it within our next revision=20
> of the document.=20
>=20
> The following link: http://faisalv.github.com/clang-glambda/, has some=20
> instructions (towards the bottom) on how to compile the code or use=20
> the binaries for windows.=20
>=20
> Any and all constructive feedback will be greatly appreciated.=20
>=20
> The current version (12/2012) implements subproposals 2.1, 2.2, 2.3 and 2=
..5.=20
>=20
> 2.1 Allow the type-specifier within a parameter declaration of a=20
> lambda to be auto (i.e. auto is mandatory)=20
>=20
> auto Sum =3D [](auto a, decltype(a) b) { return a + b; };=20
> int i =3D Sum(3, 4);=20
> double d =3D Sum(3.14, 2.77);=20
>=20
> 2.2 Allow the use of familiar template syntax in lambda expressions=20
>=20
> auto NumElements =3D []<int N>(auto (&a)[N]) { return N; };=20
> int arri[]{1, 2, 3};=20
> double arrd[]{3.14, 2.77, 6.626};=20
> auto total =3D NumElements(arri) + NumElements(arrd);=20
>=20
> 2.3 Permit a lambda body to be an expression=20
>=20
> int local =3D 10;=20
> auto L =3D [&](auto a) a + ++local;=20
>=20
> 2.5 Autogenerate a conversion to function pointer in captureless generic =
lambdas=20
>=20
> auto L =3D [](auto a, decltype(a) b) { return a + b; };=20
> int (*fp)(int, int) =3D L;=20
>=20
>=20
> Thank you and looking forward to the feedback!
> --=20
> =20
> =20
> =20
>=20
> --=20
> =20
> =20
> =20

--=20




--Apple-Mail=_5ED7E440-596B-4B1C-A70E-5FB5E8DDBFB5
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=ISO-8859-2

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dwindows-1250"><base href=3D"x-msg://934/"></head><body style=3D"word-wra=
p: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-sp=
ace; ">Wow,<div><br></div><div>This is almost same crazy as Javascript's in=
side function scoping.&nbsp;</div><div>I'm terrified to think how people wi=
ll use that in practice ;-)</div><div><br></div><div>-</div><div>Daniel Bie=
siada</div><div><br></div><div><br><div><div><div>Wiadomo=B6=E6 napisana pr=
zez Herb Sutter &lt;<a href=3D"mailto:hsutter@microsoft.com">hsutter@micros=
oft.com</a>&gt; w dniu 20 gru 2012, o godz. 21:09:</div><br class=3D"Apple-=
interchange-newline"><blockquote type=3D"cite"><div lang=3D"EN-US" link=3D"=
blue" vlink=3D"purple" style=3D"font-family: Helvetica; font-size: medium; =
font-style: normal; font-variant: normal; font-weight: normal; letter-spaci=
ng: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text=
-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-sp=
acing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;=
 "><div class=3D"WordSection1" style=3D"page: WordSection1; "><div style=3D=
"margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-seri=
f; ">Composition and currying are cool.<o:p></o:p></div><div style=3D"margi=
n: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><=
o:p>&nbsp;</o:p></div><div style=3D"margin: 0in 0in 0.0001pt; font-size: 11=
pt; font-family: Calibri, sans-serif; ">Those who don&rsquo;t like the ters=
e syntax may object that it&rsquo;s only slightly worse with the current sy=
ntax, though, right?<o:p></o:p></div><div style=3D"margin: 0in 0in 0.0001pt=
; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p>&nbsp;</o:p></d=
iv><div style=3D"margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Ca=
libri, sans-serif; ">auto compose =3D []( auto f, auto g ) { return<o:p></o=
:p></div><div style=3D"margin: 0in 0in 0.0001pt; font-size: 11pt; font-fami=
ly: Calibri, sans-serif; ">&nbsp;&nbsp;&nbsp; [=3D]( auto x ) f( g(x) ); };=
<o:p></o:p></div><div style=3D"margin: 0in 0in 0.0001pt; font-size: 11pt; f=
ont-family: Calibri, sans-serif; "><o:p>&nbsp;</o:p></div><div style=3D"mar=
gin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "=
>auto curry3 =3D<o:p></o:p></div><div style=3D"margin: 0in 0in 0.0001pt; fo=
nt-size: 11pt; font-family: Calibri, sans-serif; ">&nbsp;&nbsp; []( auto f =
) { return<o:p></o:p></div><div style=3D"margin: 0in 0in 0.0001pt; font-siz=
e: 11pt; font-family: Calibri, sans-serif; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp; [=3D](auto x) { return [=3D](auto y) { return [=3D](auto z) { return=
<o:p></o:p></div><div style=3D"margin: 0in 0in 0.0001pt; font-size: 11pt; f=
ont-family: Calibri, sans-serif; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp; f(x,y,z); }; }; }; };<o:p></o:p></div><div style=3D"ma=
rgin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; =
"><o:p>&nbsp;</o:p></div><div style=3D"margin: 0in 0in 0.0001pt; font-size:=
 11pt; font-family: Calibri, sans-serif; ">Though you do have to be a littl=
e careful to balance the {&lsquo;s and };&rsquo;s.<o:p></o:p></div><div sty=
le=3D"margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans=
-serif; "><o:p>&nbsp;</o:p></div><div style=3D"margin: 0in 0in 0.0001pt; fo=
nt-size: 11pt; font-family: Calibri, sans-serif; ">Herb<o:p></o:p></div><di=
v style=3D"margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times N=
ew Roman', serif; "><span style=3D"font-size: 11pt; font-family: Calibri, s=
ans-serif; color: rgb(31, 73, 125); ">&nbsp;</span></div><div style=3D"marg=
in: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', seri=
f; "><span style=3D"font-size: 11pt; font-family: Calibri, sans-serif; colo=
r: rgb(31, 73, 125); ">&nbsp;</span></div><div style=3D"border-style: none =
none none solid; border-left-width: 1.5pt; border-left-color: blue; padding=
: 0in 0in 0in 4pt; "><div><div style=3D"border-style: solid none none; bord=
er-top-width: 1pt; border-top-color: rgb(181, 196, 223); padding: 3pt 0in 0=
in; "><div style=3D"margin: 0in 0in 0.0001pt; font-size: 12pt; font-family:=
 'Times New Roman', serif; "><b><span style=3D"font-size: 10pt; font-family=
: Tahoma, sans-serif; ">From:</span></b><span style=3D"font-size: 10pt; fon=
t-family: Tahoma, sans-serif; "><span class=3D"Apple-converted-space">&nbsp=
;</span>Scott Prager [mailto:splinterofchaos@<a href=3D"http://gmail.com" s=
tyle=3D"color: purple; text-decoration: underline; ">gmail.com</a>]<span cl=
ass=3D"Apple-converted-space">&nbsp;</span><br><b>Sent:</b><span class=3D"A=
pple-converted-space">&nbsp;</span>Thursday, December 20, 2012 10:16 AM<br>=
<b>To:</b><span class=3D"Apple-converted-space">&nbsp;</span><a href=3D"mai=
lto:std-proposals@isocpp.org" style=3D"color: purple; text-decoration: unde=
rline; ">std-proposals@isocpp.org</a><br><b>Cc:</b><span class=3D"Apple-con=
verted-space">&nbsp;</span><a href=3D"mailto:std-discussion@isocpp.org" sty=
le=3D"color: purple; text-decoration: underline; ">std-discussion@isocpp.or=
g</a>;<span class=3D"Apple-converted-space">&nbsp;</span><a href=3D"mailto:=
faisalv@gmail.com" style=3D"color: purple; text-decoration: underline; ">fa=
isalv@gmail.com</a><br><b>Subject:</b><span class=3D"Apple-converted-space"=
>&nbsp;</span>[std-proposals] Re: An implementation of Generic lambdas (Req=
uest for feedback)<o:p></o:p></span></div></div></div><div style=3D"margin:=
 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; =
"><o:p>&nbsp;</o:p></div><p class=3D"MsoNormal" style=3D"margin: 0in 0in 12=
pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">Absolutely fa=
ntastic! A few things on interest:<br><br>I had not realized this syntax su=
pports nesting:<o:p></o:p></p><div style=3D"border: 1pt solid rgb(187, 187,=
 187); padding: 0in; word-wrap: break-word; "><div style=3D"margin: 0in 0in=
 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; backgrou=
nd-color: rgb(250, 250, 250); "><span class=3D"styled-by-prettify"><span st=
yle=3D"font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 0, 136); =
">auto</span></span><span class=3D"styled-by-prettify"><span style=3D"font-=
size: 10pt; font-family: 'Courier New'; "><span class=3D"Apple-converted-sp=
ace">&nbsp;</span>compose<span class=3D"Apple-converted-space">&nbsp;</span=
></span></span><span class=3D"styled-by-prettify"><span style=3D"font-size:=
 10pt; font-family: 'Courier New'; color: rgb(102, 102, 0); ">=3D</span></s=
pan><span class=3D"styled-by-prettify"><span style=3D"font-size: 10pt; font=
-family: 'Courier New'; ">&nbsp;</span></span><span class=3D"styled-by-pret=
tify"><span style=3D"font-size: 10pt; font-family: 'Courier New'; color: rg=
b(102, 102, 0); ">[](</span></span><span class=3D"styled-by-prettify"><span=
 style=3D"font-size: 10pt; font-family: 'Courier New'; ">&nbsp;</span></spa=
n><span class=3D"styled-by-prettify"><span style=3D"font-size: 10pt; font-f=
amily: 'Courier New'; color: rgb(0, 0, 136); ">auto</span></span><span clas=
s=3D"styled-by-prettify"><span style=3D"font-size: 10pt; font-family: 'Cour=
ier New'; "><span class=3D"Apple-converted-space">&nbsp;</span>f</span></sp=
an><span class=3D"styled-by-prettify"><span style=3D"font-size: 10pt; font-=
family: 'Courier New'; color: rgb(102, 102, 0); ">,</span></span><span clas=
s=3D"styled-by-prettify"><span style=3D"font-size: 10pt; font-family: 'Cour=
ier New'; ">&nbsp;</span></span><span class=3D"styled-by-prettify"><span st=
yle=3D"font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 0, 136); =
">auto</span></span><span class=3D"styled-by-prettify"><span style=3D"font-=
size: 10pt; font-family: 'Courier New'; "><span class=3D"Apple-converted-sp=
ace">&nbsp;</span>g<span class=3D"Apple-converted-space">&nbsp;</span></spa=
n></span><span class=3D"styled-by-prettify"><span style=3D"font-size: 10pt;=
 font-family: 'Courier New'; color: rgb(102, 102, 0); ">)</span></span><spa=
n style=3D"font-size: 10pt; font-family: 'Courier New'; "><br><span class=
=3D"styled-by-prettify">&nbsp; &nbsp;<span class=3D"Apple-converted-space">=
&nbsp;</span></span></span><span class=3D"styled-by-prettify"><span style=
=3D"font-size: 10pt; font-family: 'Courier New'; color: rgb(102, 102, 0); "=
>[=3D](</span></span><span class=3D"styled-by-prettify"><span style=3D"font=
-size: 10pt; font-family: 'Courier New'; ">&nbsp;</span></span><span class=
=3D"styled-by-prettify"><span style=3D"font-size: 10pt; font-family: 'Couri=
er New'; color: rgb(0, 0, 136); ">auto</span></span><span class=3D"styled-b=
y-prettify"><span style=3D"font-size: 10pt; font-family: 'Courier New'; "><=
span class=3D"Apple-converted-space">&nbsp;</span>x<span class=3D"Apple-con=
verted-space">&nbsp;</span></span></span><span class=3D"styled-by-prettify"=
><span style=3D"font-size: 10pt; font-family: 'Courier New'; color: rgb(102=
, 102, 0); ">)</span></span><span class=3D"styled-by-prettify"><span style=
=3D"font-size: 10pt; font-family: 'Courier New'; "><span class=3D"Apple-con=
verted-space">&nbsp;</span>f</span></span><span class=3D"styled-by-prettify=
"><span style=3D"font-size: 10pt; font-family: 'Courier New'; color: rgb(10=
2, 102, 0); ">(</span></span><span class=3D"styled-by-prettify"><span style=
=3D"font-size: 10pt; font-family: 'Courier New'; "><span class=3D"Apple-con=
verted-space">&nbsp;</span>g</span></span><span class=3D"styled-by-prettify=
"><span style=3D"font-size: 10pt; font-family: 'Courier New'; color: rgb(10=
2, 102, 0); ">(</span></span><span class=3D"styled-by-prettify"><span style=
=3D"font-size: 10pt; font-family: 'Courier New'; ">x</span></span><span cla=
ss=3D"styled-by-prettify"><span style=3D"font-size: 10pt; font-family: 'Cou=
rier New'; color: rgb(102, 102, 0); ">)</span></span><span class=3D"styled-=
by-prettify"><span style=3D"font-size: 10pt; font-family: 'Courier New'; ">=
&nbsp;</span></span><span class=3D"styled-by-prettify"><span style=3D"font-=
size: 10pt; font-family: 'Courier New'; color: rgb(102, 102, 0); ">);</span=
></span><span style=3D"font-size: 10pt; font-family: 'Courier New'; "><br><=
br></span><span class=3D"styled-by-prettify"><span style=3D"font-size: 10pt=
; font-family: 'Courier New'; color: rgb(0, 0, 136); ">auto</span></span><s=
pan class=3D"styled-by-prettify"><span style=3D"font-size: 10pt; font-famil=
y: 'Courier New'; "><span class=3D"Apple-converted-space">&nbsp;</span>curr=
y3<span class=3D"Apple-converted-space">&nbsp;</span></span></span><span cl=
ass=3D"styled-by-prettify"><span style=3D"font-size: 10pt; font-family: 'Co=
urier New'; color: rgb(102, 102, 0); ">=3D</span></span><span style=3D"font=
-size: 10pt; font-family: 'Courier New'; "><br><span class=3D"styled-by-pre=
ttify">&nbsp; &nbsp;</span></span><span class=3D"styled-by-prettify"><span =
style=3D"font-size: 10pt; font-family: 'Courier New'; color: rgb(102, 102, =
0); ">[](</span></span><span class=3D"styled-by-prettify"><span style=3D"fo=
nt-size: 10pt; font-family: 'Courier New'; ">&nbsp;</span></span><span clas=
s=3D"styled-by-prettify"><span style=3D"font-size: 10pt; font-family: 'Cour=
ier New'; color: rgb(0, 0, 136); ">auto</span></span><span class=3D"styled-=
by-prettify"><span style=3D"font-size: 10pt; font-family: 'Courier New'; ">=
<span class=3D"Apple-converted-space">&nbsp;</span>f<span class=3D"Apple-co=
nverted-space">&nbsp;</span></span></span><span class=3D"styled-by-prettify=
"><span style=3D"font-size: 10pt; font-family: 'Courier New'; color: rgb(10=
2, 102, 0); ">)</span></span><span style=3D"font-size: 10pt; font-family: '=
Courier New'; "><br><span class=3D"styled-by-prettify">&nbsp; &nbsp; &nbsp;=
 &nbsp;</span></span><span class=3D"styled-by-prettify"><span style=3D"font=
-size: 10pt; font-family: 'Courier New'; color: rgb(102, 102, 0); ">[=3D](<=
/span></span><span class=3D"styled-by-prettify"><span style=3D"font-size: 1=
0pt; font-family: 'Courier New'; color: rgb(0, 0, 136); ">auto</span></span=
><span class=3D"styled-by-prettify"><span style=3D"font-size: 10pt; font-fa=
mily: 'Courier New'; "><span class=3D"Apple-converted-space">&nbsp;</span>x=
</span></span><span class=3D"styled-by-prettify"><span style=3D"font-size: =
10pt; font-family: 'Courier New'; color: rgb(102, 102, 0); ">)</span></span=
><span class=3D"styled-by-prettify"><span style=3D"font-size: 10pt; font-fa=
mily: 'Courier New'; ">&nbsp;</span></span><span class=3D"styled-by-prettif=
y"><span style=3D"font-size: 10pt; font-family: 'Courier New'; color: rgb(1=
02, 102, 0); ">[=3D](</span></span><span class=3D"styled-by-prettify"><span=
 style=3D"font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 0, 136=
); ">auto</span></span><span class=3D"styled-by-prettify"><span style=3D"fo=
nt-size: 10pt; font-family: 'Courier New'; "><span class=3D"Apple-converted=
-space">&nbsp;</span>y</span></span><span class=3D"styled-by-prettify"><spa=
n style=3D"font-size: 10pt; font-family: 'Courier New'; color: rgb(102, 102=
, 0); ">)</span></span><span class=3D"styled-by-prettify"><span style=3D"fo=
nt-size: 10pt; font-family: 'Courier New'; ">&nbsp;</span></span><span clas=
s=3D"styled-by-prettify"><span style=3D"font-size: 10pt; font-family: 'Cour=
ier New'; color: rgb(102, 102, 0); ">[=3D](</span></span><span class=3D"sty=
led-by-prettify"><span style=3D"font-size: 10pt; font-family: 'Courier New'=
; color: rgb(0, 0, 136); ">auto</span></span><span class=3D"styled-by-prett=
ify"><span style=3D"font-size: 10pt; font-family: 'Courier New'; "><span cl=
ass=3D"Apple-converted-space">&nbsp;</span>z</span></span><span class=3D"st=
yled-by-prettify"><span style=3D"font-size: 10pt; font-family: 'Courier New=
'; color: rgb(102, 102, 0); ">)</span></span><span class=3D"styled-by-prett=
ify"><span style=3D"font-size: 10pt; font-family: 'Courier New'; ">&nbsp;</=
span></span><span style=3D"font-size: 10pt; font-family: 'Courier New'; "><=
br><span class=3D"styled-by-prettify">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp;f</span></span><span class=3D"styled-by-prettify"><span style=3D"font-s=
ize: 10pt; font-family: 'Courier New'; color: rgb(102, 102, 0); ">(</span><=
/span><span class=3D"styled-by-prettify"><span style=3D"font-size: 10pt; fo=
nt-family: 'Courier New'; ">x</span></span><span class=3D"styled-by-prettif=
y"><span style=3D"font-size: 10pt; font-family: 'Courier New'; color: rgb(1=
02, 102, 0); ">,</span></span><span class=3D"styled-by-prettify"><span styl=
e=3D"font-size: 10pt; font-family: 'Courier New'; ">y</span></span><span cl=
ass=3D"styled-by-prettify"><span style=3D"font-size: 10pt; font-family: 'Co=
urier New'; color: rgb(102, 102, 0); ">,</span></span><span class=3D"styled=
-by-prettify"><span style=3D"font-size: 10pt; font-family: 'Courier New'; "=
>z</span></span><span class=3D"styled-by-prettify"><span style=3D"font-size=
: 10pt; font-family: 'Courier New'; color: rgb(102, 102, 0); ">);</span></s=
pan><span style=3D"font-size: 10pt; font-family: 'Courier New'; "><o:p></o:=
p></span></div></div><div id=3D"file-generic-lambda-tests-cpp-LC13"><div id=
=3D"file-generic-lambda-tests-cpp-LC24"><pre style=3D"margin: 0in 0in 12pt;=
 font-size: 10pt; font-family: 'Courier New'; "><br><span class=3D"p">And v=
ariadic lambdas, too! Very nice. </span><br><span class=3D"p">But I wonder =
why we couldn't...<o:p></o:p></span></pre><div style=3D"border: 1pt solid r=
gb(187, 187, 187); padding: 0in; word-wrap: break-word; "><pre style=3D"mar=
gin: 0in 0in 0.0001pt; font-size: 10pt; font-family: 'Courier New'; backgro=
und-color: rgb(250, 250, 250); background-position: initial initial; backgr=
ound-repeat: initial initial; "><span class=3D"styled-by-prettify"><span st=
yle=3D"color: rgb(0, 0, 136); ">auto</span><span style=3D""> f </span><span=
 style=3D"color: rgb(102, 102, 0); ">=3D</span><span style=3D""> </span><sp=
an style=3D"color: rgb(102, 102, 0); ">[](</span><span style=3D""> </span><=
span style=3D"color: rgb(0, 0, 136); ">auto</span><span style=3D""> _f </sp=
an><span style=3D"color: rgb(102, 102, 0); ">)</span><span style=3D""> </sp=
an><span style=3D"color: rgb(102, 102, 0); ">[](</span><span style=3D"color=
: rgb(0, 0, 136); ">auto</span><span style=3D""> </span><span style=3D"colo=
r: rgb(102, 102, 0); ">...</span><span style=3D"">x</span><span style=3D"co=
lor: rgb(102, 102, 0); ">)</span><span style=3D""> _f</span><span style=3D"=
color: rgb(102, 102, 0); ">(</span><span style=3D"">x</span><span style=3D"=
color: rgb(102, 102, 0); ">...);</span></span><o:p></o:p></pre></div><pre s=
tyle=3D"margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: 'Courier Ne=
w'; "><br><span class=3D"p">I wrote some tests. A few lines caused the comp=
iler to crash so I commented them out and labelled them "Crash!".</span><br=
><br><span class=3D"p"><a href=3D"https://gist.github.com/4347130" style=3D=
"color: purple; text-decoration: underline; ">https://gist.github.com/43471=
30</a></span><o:p></o:p></pre></div></div><div style=3D"margin: 0in 0in 0.0=
001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><br><br>On=
 Monday, December 17, 2012 2:05:37 PM UTC-5, faisalv wrote:<o:p></o:p></div=
><div style=3D"margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Tim=
es New Roman', serif; ">Motivated by the positive feedback we received rega=
rding Generic<span class=3D"Apple-converted-space">&nbsp;</span><br>Lambdas=
 (during the October 2012 ISO C++ Standards Meeting in<span class=3D"Apple-=
converted-space">&nbsp;</span><br>Portland), I have implemented a reasonabl=
y complete (unless I am<span class=3D"Apple-converted-space">&nbsp;</span><=
br>missing something obvious) implementation<span class=3D"Apple-converted-=
space">&nbsp;</span><br>(<a href=3D"http://faisalv.github.com/clang-glambda=
/" target=3D"_blank" style=3D"color: purple; text-decoration: underline; ">=
http://faisalv.github.com/clang-glambda/</a>) of most of the proposal<span =
class=3D"Apple-converted-space">&nbsp;</span><br>(named lambda syntax for f=
unctions has not been attempted) using a<span class=3D"Apple-converted-spac=
e">&nbsp;</span><br>fork of clang.<span class=3D"Apple-converted-space">&nb=
sp;</span><br><br>We would like to encourage developers who are interested =
in this<span class=3D"Apple-converted-space">&nbsp;</span><br>feature, to e=
ither compile the code or download the binaries (sorry,<span class=3D"Apple=
-converted-space">&nbsp;</span><br>only windows for now) and play with the =
implementation and provide us<span class=3D"Apple-converted-space">&nbsp;</=
span><br>with feedback so that we can incorporate it within our next revisi=
on<span class=3D"Apple-converted-space">&nbsp;</span><br>of the document.<s=
pan class=3D"Apple-converted-space">&nbsp;</span><br><br>The following link=
:<span class=3D"Apple-converted-space">&nbsp;</span><a href=3D"http://faisa=
lv.github.com/clang-glambda/" target=3D"_blank" style=3D"color: purple; tex=
t-decoration: underline; ">http://faisalv.github.com/clang-glambda/</a>, ha=
s some<span class=3D"Apple-converted-space">&nbsp;</span><br>instructions (=
towards the bottom) on how to compile the code or use<span class=3D"Apple-c=
onverted-space">&nbsp;</span><br>the binaries for windows.<span class=3D"Ap=
ple-converted-space">&nbsp;</span><br><br>Any and all constructive feedback=
 will be greatly appreciated.<span class=3D"Apple-converted-space">&nbsp;</=
span><br><br>The current version (12/2012) implements subproposals 2.1, 2.2=
, 2.3 and 2.5.<span class=3D"Apple-converted-space">&nbsp;</span><br><br>2.=
1 Allow the type-specifier within a parameter declaration of a<span class=
=3D"Apple-converted-space">&nbsp;</span><br>lambda to be auto (i.e. auto is=
 mandatory)<span class=3D"Apple-converted-space">&nbsp;</span><br><br>auto =
Sum =3D [](auto a, decltype(a) b) { return a + b; };<span class=3D"Apple-co=
nverted-space">&nbsp;</span><br>int i =3D Sum(3, 4);<span class=3D"Apple-co=
nverted-space">&nbsp;</span><br>double d =3D Sum(3.14, 2.77);<span class=3D=
"Apple-converted-space">&nbsp;</span><br><br>2.2 Allow the use of familiar =
template syntax in lambda expressions<span class=3D"Apple-converted-space">=
&nbsp;</span><br><br>auto NumElements =3D []&lt;int N&gt;(auto (&amp;a)[N])=
 { return N; };<span class=3D"Apple-converted-space">&nbsp;</span><br>int a=
rri[]{1, 2, 3};<span class=3D"Apple-converted-space">&nbsp;</span><br>doubl=
e arrd[]{3.14, 2.77, 6.626};<span class=3D"Apple-converted-space">&nbsp;</s=
pan><br>auto total =3D NumElements(arri) + NumElements(arrd);<span class=3D=
"Apple-converted-space">&nbsp;</span><br><br>2.3 Permit a lambda body to be=
 an expression<span class=3D"Apple-converted-space">&nbsp;</span><br><br>in=
t local =3D 10;<span class=3D"Apple-converted-space">&nbsp;</span><br>auto =
L =3D [&amp;](auto a) a + ++local;<span class=3D"Apple-converted-space">&nb=
sp;</span><br><br>2.5 Autogenerate a conversion to function pointer in capt=
ureless generic lambdas<span class=3D"Apple-converted-space">&nbsp;</span><=
br><br>auto L =3D [](auto a, decltype(a) b) { return a + b; };<span class=
=3D"Apple-converted-space">&nbsp;</span><br>int (*fp)(int, int) =3D L;<span=
 class=3D"Apple-converted-space">&nbsp;</span><br><br><br>Thank you and loo=
king forward to the feedback!<o:p></o:p></div><div style=3D"margin: 0in 0in=
 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">--<spa=
n class=3D"Apple-converted-space">&nbsp;</span><br>&nbsp;<br>&nbsp;<br>&nbs=
p;<o:p></o:p></div></div></div><div style=3D"margin-right: 0in; margin-left=
: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><br class=
=3D"webkit-block-placeholder"></div>--<span class=3D"Apple-converted-space"=
>&nbsp;</span><br>&nbsp;<br>&nbsp;<br>&nbsp;<br></div></blockquote></div><b=
r></div></div></body></html>

<p></p>

-- <br />
&nbsp;<br />
&nbsp;<br />
&nbsp;<br />

--Apple-Mail=_5ED7E440-596B-4B1C-A70E-5FB5E8DDBFB5--

.
