Topic: any plans for alowing templates to take lambdas


Author: =?ISO-8859-1?Q?Daniel_Kr=FCgler?= <daniel.kruegler@gmail.com>
Date: Fri, 31 May 2013 15:14:24 +0200
Raw View
2013/5/31  <nx02columbia@gmail.com>:
> Hi,
> I know reasons why lambdas cant be used as template arguments atm(lambda is
> not a type, jada jada, decltype... -
> http://stackoverflow.com/questions/5849059/lambda-expressions-as-class-template-parameters)

If you know the "why", what is your complain?

>  but as a usability feature it would be a great addition to C++.
> This way it is "unusable", aka it is simpler just to make a named function.

This is a possible solution, yes.

- Daniel

--

---
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/?hl=en.



.


Author: Nicol Bolas <jmckesson@gmail.com>
Date: Fri, 31 May 2013 07:00:49 -0700 (PDT)
Raw View
------=_Part_754_35077.1370008849808
Content-Type: text/plain; charset=ISO-8859-1

On Friday, May 31, 2013 6:12:18 AM UTC-7, nx02co...@gmail.com wrote:
>
> Hi,
> I know reasons why lambdas cant be used as template arguments atm(lambda
> is not a type, jada jada, decltype... -
> http://stackoverflow.com/questions/5849059/lambda-expressions-as-class-template-parameters)
> ,
>  but as a usability feature it would be a great addition to C++.
> This way it is "unusable", aka it is simpler just to make a named
> function.
>

And what exactly is wrong with making a named function? What is it with
people and their need to use lambdas for *everything*? I know lambdas are
your sexy new C++11 feature, but really, what is the problem with using a
specific type that has a real name?

struct name { void operator()() {} };

Why is this so hard to do?

--

---
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/?hl=en.



------=_Part_754_35077.1370008849808
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Friday, May 31, 2013 6:12:18 AM UTC-7, nx02co...@gmail.com wrote:<blockq=
uote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-lef=
t: 1px #ccc solid;padding-left: 1ex;">Hi, <br>I know reasons why lambdas ca=
nt be used as template arguments atm(lambda is not a type, jada jada, declt=
ype... - <a href=3D"http://stackoverflow.com/questions/5849059/lambda-expre=
ssions-as-class-template-parameters" target=3D"_blank">http://stackoverflow=
..com/<wbr>questions/5849059/lambda-<wbr>expressions-as-class-template-<wbr>=
parameters</a>) ,<br>&nbsp;but as a usability feature it would be a great a=
ddition to C++.<br>This way it is "unusable", aka it is simpler just to mak=
e a named function. <br></blockquote><div><br>And what exactly is wrong wit=
h making a named function? What is it with people and their need to use lam=
bdas for <i>everything</i>? I know lambdas are your sexy new C++11 feature,=
 but really, what is the problem with using a specific type that has a real=
 name?<br><br><div class=3D"prettyprint" style=3D"background-color: rgb(250=
, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-=
width: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><div class=
=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">struct</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
name </span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #008;" class=3D"styled-by-prettify">void</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #008;" class=3D"styled-by-prettify">operator</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">()()</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">{}</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">};</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
</span></div></code></div><br>Why is this so hard to do?<br></div>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_754_35077.1370008849808--

.


Author: Martinho Fernandes <martinho.fernandes@gmail.com>
Date: Fri, 31 May 2013 16:26:51 +0200
Raw View
--f46d0447858fe8711b04de0467bc
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I hope I am missing something here, because all this talk about lambdas as
template arguments improving usability sounds like nonsense to me. What can
you do with a lambda type that makes them so usable as template arguments?

Without requiring lambda types to be default-constructible, I don't see how
this makes anything more usable.

using my_set =3D std::set<int, decltype([](int x, int y) { return f(x) <
f(y); })>;
my_set haha_nice_try; // nope, error
my_set some_set([](int x, int y) { return f(x) < f(y); }); // erm, error!
my_set some_other_set([](int x, int y) { return f(x) < f(y); }); // ok,
let's assume at least lambdas identical character-by-character are the same
type; then this works

What? I have to repeat the function definition *everywhere*? And that
doesn't work anyway? No, thanks.
Of course, I can just declare the lambda as a global variable instead:

auto comparison =3D [](int x, int y) { return f(x) < f(y); };
using my_set =3D std::set<int, decltype(comparison)>;
my_set haha_nice_try; // nope, still an error
my_set some_set(comparison); // ok, now this works
my_set some_other_set(comparison); // but don't you forget to pass the
comparison along every single time lest you unless the compiler's wrath
upon you!

Stop it. This has no interesting advantage over using a function.

bool comparison(int x, int y) { return f(x) < f(y); };
using my_set =3D std::set<int, decltype(comparison)>;
my_set haha_nice_try; // also an error!
my_set some_set(comparison); // has always worked
my_set some_other_set(comparison); // keep not forgetting it!

Note how the comparison is not really entirely part of the set. You have to
keep passing it along anytime you create one. That sucks.

struct my_comparison {
    bool operator()(int x, int y) { return f(x) < f(y); }
};

using my_set =3D std::set<int, my_comparison>;
my_set haha_nice_try; // hey, it works
my_set some_set(my_comparison{}); // you can, but why would you?
my_set some_other_set;

Note how the proposal to get lifted functions would also be cool here.

bool comparison(int x, int y) { return f(x) < f(y); };
using my_set =3D std::set<int, decltype([]comparison)>;
my_set haha_nice_try;
my_set some_set;
my_set some_other_set; // all work fine

Mit freundlichen Gr=FC=DFen,

Martinho


On Fri, May 31, 2013 at 3:12 PM, <nx02columbia@gmail.com> wrote:

> Hi,
> I know reasons why lambdas cant be used as template arguments atm(lambda
> is not a type, jada jada, decltype... -
> http://stackoverflow.com/questions/5849059/lambda-expressions-as-class-te=
mplate-parameters)
> ,
>  but as a usability feature it would be a great addition to C++.
> This way it is "unusable", aka it is simpler just to make a named
> function.
> --
>
> ---
> 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/?hl=3Den.
>
>
>

--=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/?hl=3Den.



--f46d0447858fe8711b04de0467bc
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div><div>I hope I am missing something here, because=
 all this talk about lambdas as template arguments improving usability soun=
ds like nonsense to me. What can you do with a lambda type that makes them =
so usable as template arguments?<br>
<br>Without requiring lambda types to be default-constructible, I don&#39;t=
 see how this makes anything more usable.<br><br></div><span style=3D"font-=
family:courier new,monospace">using my_set =3D std::set&lt;int, decltype([]=
(int x, int y) { return f(x) &lt; f(y); })&gt;;<br>
</span></div><span style=3D"font-family:courier new,monospace">my_set haha_=
nice_try; // nope, error<br>my_set some_set([](int x, int y) { return f(x) =
&lt; f(y); }); // erm, error!<br></span><div><span style=3D"font-family:cou=
rier new,monospace">my_set some_other_set([](int x, int y) { return f(x) &l=
t; f(y); }); // ok, let&#39;s assume at least lambdas identical character-b=
y-character are the same type; then this works<br>
</span><div><br></div></div><div>What? I have to repeat the function defini=
tion *everywhere*? And that doesn&#39;t work anyway? No, thanks.<br></div><=
div>Of course, I can just declare the lambda as a global variable instead:<=
br>
<br><span style=3D"font-family:courier new,monospace">auto comparison =3D <=
/span><span style=3D"font-family:courier new,monospace"><span style=3D"font=
-family:courier new,monospace">[](int x, int y) { return f(x) &lt; f(y); };=
<br>
</span>using my_set =3D std::set&lt;int, decltype(comparison)&gt;;<br></spa=
n><span style=3D"font-family:courier new,monospace">my_set haha_nice_try; /=
/ nope, still an error<br>my_set some_set(comparison); // ok, now this work=
s<br>
</span><span style=3D"font-family:courier new,monospace">my_set
 some_other_set(</span><span style=3D"font-family:courier new,monospace"><s=
pan style=3D"font-family:courier new,monospace">comparison</span>); // but =
don&#39;t you forget to pass the comparison along every single time lest yo=
u unless the compiler&#39;s wrath upon you!</span><br>
<br></div><div>Stop it. This has no interesting advantage over using a func=
tion.<br><br><span style=3D"font-family:courier new,monospace">bool compari=
son</span><span style=3D"font-family:courier new,monospace"><span style=3D"=
font-family:courier new,monospace">(int x, int y) { return f(x) &lt; f(y); =
};<br>
</span>using my_set =3D std::set&lt;int, decltype(comparison)&gt;;<br></spa=
n><span style=3D"font-family:courier new,monospace">my_set haha_nice_try; /=
/ also an error!<br>my_set some_set(comparison); // has always worked<br></=
span><span style=3D"font-family:courier new,monospace">my_set
 some_other_set(</span><span style=3D"font-family:courier new,monospace"><s=
pan style=3D"font-family:courier new,monospace">comparison</span>); // keep=
 not forgetting it!</span><br></div><div><br></div><div>Note how the compar=
ison is not really entirely part of the set. You have to keep passing it al=
ong anytime you create one. That sucks.<br>
</div><div><br></div><div><span style=3D"font-family:courier new,monospace"=
>struct my_comparison {<br></span></div><div><span style=3D"font-family:cou=
rier new,monospace">=A0=A0=A0 bool operator()(int x, int y) { return f(x) &=
lt; f(y); }<br>
</span></div><div><span style=3D"font-family:courier new,monospace">};<br><=
/span></div><div><div class=3D"gmail_extra"><span style=3D"font-family:cour=
ier new,monospace"><br></span></div><span style=3D"font-family:courier new,=
monospace">using my_set =3D std::set&lt;int, my_comparison&gt;;<br>
</span><span style=3D"font-family:courier new,monospace">my_set haha_nice_t=
ry; // hey, it works<br>my_set some_set(my_comparison{}); // you can, but w=
hy would you?<br></span><span style=3D"font-family:courier new,monospace">m=
y_set some_other_set;</span><br>
<br><div class=3D"gmail_extra"><div></div><div>Note how the proposal to get=
 lifted functions would also be cool here.<br></div><div><span style=3D"fon=
t-family:courier new,monospace"><br>bool comparison</span><span style=3D"fo=
nt-family:courier new,monospace"><span style=3D"font-family:courier new,mon=
ospace">(int x, int y) { return f(x) &lt; f(y); };<br>
</span>using my_set =3D std::set&lt;int, decltype([]comparison)&gt;;<br></s=
pan><span style=3D"font-family:courier new,monospace">my_set haha_nice_try;=
<br>my_set some_set;<br></span><span style=3D"font-family:courier new,monos=
pace">my_set
 some_other_set</span><span style=3D"font-family:courier new,monospace">; /=
/ all work fine</span><br><br>Mit freundlichen Gr=FC=DFen,<br><br>Martinho<=
/div>
<br><br><div class=3D"gmail_quote">On Fri, May 31, 2013 at 3:12 PM,  <span =
dir=3D"ltr">&lt;<a href=3D"mailto:nx02columbia@gmail.com" target=3D"_blank"=
>nx02columbia@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail=
_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204=
,204);padding-left:1ex">
Hi, <br>I know reasons why lambdas cant be used as template arguments atm(l=
ambda is not a type, jada jada, decltype... - <a href=3D"http://stackoverfl=
ow.com/questions/5849059/lambda-expressions-as-class-template-parameters" t=
arget=3D"_blank">http://stackoverflow.com/questions/5849059/lambda-expressi=
ons-as-class-template-parameters</a>) ,<br>
=A0but as a usability feature it would be a great addition to C++.<br>This =
way it is &quot;unusable&quot;, aka it is simpler just to make a named func=
tion. <br><span class=3D""><font color=3D"#888888">



-- <br>
=A0<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%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den" target=3D"_blank">http://groups.google.com/a/isocpp=
..org/group/std-proposals/?hl=3Den</a>.<br>
=A0<br>
=A0<br>
</font></span></blockquote></div><br></div></div></div></div>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

--f46d0447858fe8711b04de0467bc--

.


Author: =?ISO-8859-1?Q?Daniel_Kr=FCgler?= <daniel.kruegler@gmail.com>
Date: Fri, 31 May 2013 16:32:40 +0200
Raw View
2013/5/31 Martinho Fernandes <martinho.fernandes@gmail.com>:
> I hope I am missing something here, because all this talk about lambdas as
> template arguments improving usability sounds like nonsense to me. What can
> you do with a lambda type that makes them so usable as template arguments?

My assumption was that the OP was concerned about the restriction that
lambda *expressions* cannot appear in an unevaluated operand.

We also have the following core language issue related to that

www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1607

- Daniel

--

---
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/?hl=en.



.


Author: Mikhail Semenov <mikhailsemenov1957@gmail.com>
Date: Sun, 2 Jun 2013 04:42:02 -0700 (PDT)
Raw View
------=_Part_3_29581640.1370173322931
Content-Type: text/plain; charset=ISO-8859-1

With lambda autos or templates I will be able to do this:

*class B
{
    std::vector<double> y;
public:
    B(const std::vector<double>& y1);

    std::vector<double> add_vector(std::vector<double>&& z);

    std::vector<double> add_vector(const std::vector<double>& z)
const;
};*
**
*#define member_delegate(_a,_fn)\
[&](auto&& ... _x)\
{\
    return (_a)._fn(std::forward<decltype(_x)>(_x) ...);\
}*
**
*or maybe(???)*

*#define member_delegate(_a,_fn)\
template <class ... _Args>\
[&](_Args&& ... _x)\
{\
    return (_a)._fn(std::forward<_Args>(_x) ...);\
}*

In main:
*B b1(some_vector);*
**
*auto b_add = member_delegate(b1,add_vector); *
**
*std::vector<double> v1 = b_add(v);* // *selects
add_vector(std::vector<double>&& z)*
*std::vector<double> v2 = b_add(std::move(v));* // *selects
add_vector(const std::vector<double>& z) const;**
*
If autos work then probably templates are not needed.

--

---
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/?hl=en.



------=_Part_3_29581640.1370173322931
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>With lambda autos or templates I will be able to do this:</div><div>&n=
bsp;</div><div><strong>class B<br>{&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp=
; std::vector&lt;double&gt; y;<br>public:<br>&nbsp;&nbsp;&nbsp; B(const std=
::vector&lt;double&gt;&amp; y1); <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <=
br>&nbsp;&nbsp;&nbsp; std::vector&lt;double&gt; add_vector(std::vector&lt;d=
ouble&gt;&amp;&amp; z);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; std::v=
ector&lt;double&gt; add_vector(const std::vector&lt;double&gt;&amp; z) cons=
t;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>};</strong></div><div><strong></=
strong>&nbsp;</div><div><strong>#define member_delegate(_a,_fn)\<br>[&amp;]=
(auto&amp;&amp; ... _x)\<br>{\<br>&nbsp;&nbsp;&nbsp; return (_a)._fn(std::f=
orward&lt;decltype(_x)&gt;(_x) ...);\<br>}</strong></div><div><strong></str=
ong>&nbsp;</div><div><strong>or maybe(???)</strong></div><div><br><strong>#=
define member_delegate(_a,_fn)\<br>template &lt;class ... _Args&gt;\<br>[&a=
mp;](_Args&amp;&amp; ... _x)\<br>{\<br>&nbsp;&nbsp;&nbsp; return (_a)._fn(s=
td::forward&lt;_Args&gt;(_x) ...);\<br>}</strong></div><div><br>In main:<br=
><strong>B b1(some_vector);</strong></div><div><strong></strong>&nbsp;</div=
><div><strong>auto b_add =3D member_delegate(b1,add_vector); </strong></div=
><div><strong></strong>&nbsp;</div><div><strong>std::vector&lt;double&gt; v=
1 =3D b_add(v);</strong> // <em>selects add_vector(std::vector&lt;double&gt=
;&amp;&amp; z)</em></div><div><strong>std::vector&lt;double&gt; v2 =3D b_ad=
d(std::move(v));</strong> // <em>selects add_vector(const std::vector&lt;do=
uble&gt;&amp; z) const;</em><strong> <br></strong></div><div>If autos work =
then probably templates are not needed.<br></div>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_3_29581640.1370173322931--

.


Author: Mikhail Semenov <mikhailsemenov1957@gmail.com>
Date: Sun, 2 Jun 2013 05:16:52 -0700 (PDT)
Raw View
------=_Part_34_15703464.1370175412688
Content-Type: text/plain; charset=ISO-8859-1

With lambda autos or templates I will be able to do this:
*class B
{
    std::vector<double> y;
public:
    B(const std::vector<double>& y1);

    std::vector<double> add_vector(std::vector<double>&& z);

    std::vector<double> add_vector(const std::vector<double>& z)
const;
};*

*#define member_delegate(_a,_fn)\
[&](auto&& ... _x)\
{\
    return (_a)._fn(std::forward<decltype(_x)>(_x) ...);\
}*

or maybe(???)

*#define member_delegate(_a,_fn)\
template <class ... _Args>\
[&](_Args&& ... _x)\
{\
    return (_a)._fn(std::forward<_Args>(_x) ...);\
}*

Some statements:

*B b1(some_vector);*
*auto b_add = member_delegate(b1,add_vector); *
*std::vector<double> v1 = b_add(v); // add_vector(const
std::vector<double>& z) const*
*std::vector<double> v2 = b_add(std::move(v)); // selects
add_vector(std::vector<double>&& z)*

If autos work then probably templates are not needed.

--

---
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/?hl=en.



------=_Part_34_15703464.1370175412688
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>With lambda autos or templates I will be able to do this:</div><div><s=
trong><font face=3D"courier new,monospace">class B<br>{&nbsp;&nbsp;&nbsp; <=
br>&nbsp;&nbsp;&nbsp; std::vector&lt;double&gt; y;<br>public:<br>&nbsp;&nbs=
p;&nbsp; B(const std::vector&lt;double&gt;&amp; y1); <br>&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; std::vector&lt;double&gt; add_vec=
tor(std::vector&lt;double&gt;&amp;&amp; z);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp=
;&nbsp;&nbsp; std::vector&lt;double&gt; add_vector(const std::vector&lt;dou=
ble&gt;&amp; z) const;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>};</font></s=
trong></div><div>&nbsp;</div><div><strong><font face=3D"courier new,monospa=
ce">#define member_delegate(_a,_fn)\<br>[&amp;](auto&amp;&amp; ... _x)\<br>=
{\<br>&nbsp;&nbsp;&nbsp; return (_a)._fn(std::forward&lt;decltype(_x)&gt;(_=
x) ...);\<br>}</font></strong></div><div>&nbsp;</div><div>or maybe(???)</di=
v><div>&nbsp;</div><div><font face=3D"courier new,monospace"><strong>#defin=
e member_delegate(_a,_fn)\<br>template &lt;class ... _Args&gt;\<br>[&amp;](=
_Args&amp;&amp; ... _x)\<br>{\<br>&nbsp;&nbsp;&nbsp; return (_a)._fn(std::f=
orward&lt;_Args&gt;(_x) ...);\<br>}</strong></font></div><div><br>Some stat=
ements:</div><div>&nbsp;</div><div><font face=3D"courier new,monospace"><st=
rong>B b1(some_vector);</strong></font></div><div><font face=3D"courier new=
,monospace"><strong>auto b_add =3D member_delegate(b1,add_vector); </strong=
></font></div><div><font face=3D"courier new,monospace"><strong>std::vector=
&lt;double&gt; v1 =3D b_add(v); <em>// add_vector(const std::vector&lt;doub=
le&gt;&amp; z) const</em></strong></font></div><div><font face=3D"courier n=
ew,monospace"><strong>std::vector&lt;double&gt; v2 =3D b_add(std::move(v));=
 <em>// selects add_vector(std::vector&lt;double&gt;&amp;&amp; z)</em></str=
ong></font></div><div><br>If autos work then probably templates are not nee=
ded.<br></div><div>
<br></div>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_34_15703464.1370175412688--

.


Author: =?UTF-8?Q?R=C3=B3bert_D=C3=A1vid?= <lrdxgm@gmail.com>
Date: Sun, 2 Jun 2013 16:53:18 -0700 (PDT)
Raw View
------=_Part_2126_33060953.1370217198949
Content-Type: text/plain; charset=ISO-8859-1

Yay, another soul with the same "problems" :)

I have made a proposal about default-constructing closures, back in march<https://groups.google.com/a/isocpp.org/d/msg/std-proposals/FFDxYOGv5kA/fDpd4Gg4XBcJ>,
but 5.1.2 [expr.prim.lambda] paragraph 2 makes it effectively useless -
although it works fine with MSVC10 (e.g. a std::map with a lambda
comparator, passing the closure at construction), but not portable: even in
MSVC11 it breaks. This one is the other way around, it is useless without
default-constructed closures..

In the linked core issue, I like second solution - if you are using a
lambda, you most probably want internal linkage anyway.

Regards, Robert

--

---
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/?hl=en.



------=_Part_2126_33060953.1370217198949
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Yay, another soul with the same "problems" :)<br><br>I have made a proposal=
 about default-constructing closures, back in <a href=3D"https://groups.goo=
gle.com/a/isocpp.org/d/msg/std-proposals/FFDxYOGv5kA/fDpd4Gg4XBcJ">march</a=
>, but 5.1.2 [expr.prim.lambda] paragraph
2 makes it effectively useless - although it works fine with MSVC10 (e.g. a=
 std::map with a lambda comparator, passing the closure at construction), b=
ut not portable: even in MSVC11 it breaks. This one is the other way around=
, it is useless without default-constructed closures..<br><br>In the linked=
 core issue, I like second solution - if you are using a lambda, you most p=
robably want internal linkage anyway.<br><br>Regards, Robert<br>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_2126_33060953.1370217198949--

.


Author: Martinho Fernandes <martinho.fernandes@gmail.com>
Date: Mon, 3 Jun 2013 13:29:24 +0200
Raw View
--20cf3074d926d814af04de3e46ae
Content-Type: text/plain; charset=ISO-8859-1

On Sun, Jun 2, 2013 at 1:42 PM, Mikhail Semenov <
mikhailsemenov1957@gmail.com> wrote:

> With lambda autos or templates I will be able to do this:
>
> *class B
> {
>     std::vector<double> y;
> public:
>     B(const std::vector<double>& y1);
>
>     std::vector<double> add_vector(std::vector<double>&& z);
>
>     std::vector<double> add_vector(const std::vector<double>& z)
> const;
> };*
> **
> *#define member_delegate(_a,_fn)\
> [&](auto&& ... _x)\
> {\
>     return (_a)._fn(std::forward<decltype(_x)>(_x) ...);\
> }*
> **
> *or maybe(???)*
>
> *#define member_delegate(_a,_fn)\
> template <class ... _Args>\
> [&](_Args&& ... _x)\
> {\
>     return (_a)._fn(std::forward<_Args>(_x) ...);\
> }*
>
> In main:
> *B b1(some_vector);*
> **
> *auto b_add = member_delegate(b1,add_vector); *
> **
> *std::vector<double> v1 = b_add(v);* // *selects
> add_vector(std::vector<double>&& z)*
> *std::vector<double> v2 = b_add(std::move(v));* // *selects
> add_vector(const std::vector<double>& z) const;**
> *
> If autos work then probably templates are not needed.
>

What do you mean by "lambda autos"? Using lambdas to initialise
type-inferred variables? We had that feature since C++11 (and it was
available in various implementations way before that). I don't see any
lambda types as template arguments or any lambda as an unevaluated argument
there.

What that code seems to need is N3617.

--

---
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/?hl=en.



--20cf3074d926d814af04de3e46ae
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Sun, Jun 2, 2013 at 1:42 PM, Mikhail Semenov <span dir=
=3D"ltr">&lt;<a href=3D"mailto:mikhailsemenov1957@gmail.com" target=3D"_bla=
nk">mikhailsemenov1957@gmail.com</a>&gt;</span> wrote:<br><div class=3D"gma=
il_extra">

<div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>With lambda =
autos or templates I will be able to do this:</div><div>=A0</div><div><b>cl=
ass B<br>

{=A0=A0=A0 <br>=A0=A0=A0 std::vector&lt;double&gt; y;<br>public:<br>=A0=A0=
=A0 B(const std::vector&lt;double&gt;&amp; y1); <br>=A0=A0=A0=A0=A0=A0 <br>=
=A0=A0=A0 std::vector&lt;double&gt; add_vector(std::vector&lt;double&gt;&am=
p;&amp; z);<br>=A0=A0=A0 <br>=A0=A0=A0 std::vector&lt;double&gt; add_vector=
(const std::vector&lt;double&gt;&amp; z) const;=A0=A0=A0=A0=A0=A0 <br>

};</b></div><div><b></b>=A0</div><div><b>#define member_delegate(_a,_fn)\<b=
r>[&amp;](auto&amp;&amp; ... _x)\<br>{\<br>=A0=A0=A0 return (_a)._fn(std::f=
orward&lt;decltype(_x)&gt;(_x) ...);\<br>}</b></div><div><b></b>=A0</div><d=
iv><b>or maybe(???)</b></div>

<div><br><b>#define member_delegate(_a,_fn)\<br>template &lt;class ... _Arg=
s&gt;\<br>[&amp;](_Args&amp;&amp; ... _x)\<br>{\<br>=A0=A0=A0 return (_a)._=
fn(std::forward&lt;_Args&gt;(_x) ...);\<br>}</b></div><div><br>In main:<br>=
<b>B b1(some_vector);</b></div>

<div><b></b>=A0</div><div><b>auto b_add =3D member_delegate(b1,add_vector);=
 </b></div><div><b></b>=A0</div><div><b>std::vector&lt;double&gt; v1 =3D b_=
add(v);</b> // <i>selects add_vector(std::vector&lt;double&gt;&amp;&amp; z)=
</i></div>

<div><b>std::vector&lt;double&gt; v2 =3D b_add(std::move(v));</b> // <i>sel=
ects add_vector(const std::vector&lt;double&gt;&amp; z) const;</i><b> <br><=
/b></div><div>If autos work then probably templates are not needed.<br></di=
v>

</blockquote><div><br></div><div>What do you mean by &quot;lambda autos&quo=
t;? Using lambdas to initialise type-inferred variables? We had that featur=
e since C++11 (and it was available in various implementations way before t=
hat). I don&#39;t see any lambda types as template arguments or any lambda =
as an unevaluated argument there.<br>

<br>What that code seems to need is N3617.<br></div></div></div></div>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

--20cf3074d926d814af04de3e46ae--

.


Author: Martinho Fernandes <martinho.fernandes@gmail.com>
Date: Mon, 3 Jun 2013 13:30:27 +0200
Raw View
--001a11332fea99521404de3e4a6b
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Mon, Jun 3, 2013 at 1:29 PM, Martinho Fernandes <
martinho.fernandes@gmail.com> wrote:

> What that code seems to need is N3617.
>

For clarity, what N3617 enables here is first-class overloads, aka
overloads-as-function-objects.

Mit freundlichen Gr=FC=DFen,

Martinho

--=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/?hl=3Den.



--001a11332fea99521404de3e4a6b
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On M=
on, Jun 3, 2013 at 1:29 PM, Martinho Fernandes <span dir=3D"ltr">&lt;<a hre=
f=3D"mailto:martinho.fernandes@gmail.com" target=3D"_blank">martinho.fernan=
des@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div cla=
ss=3D"gmail_quote"><div>What that code seems to need is N3617.<br></div></d=
iv></div>

</blockquote></div><br></div><div class=3D"gmail_extra">For clarity, what N=
3617 enables here is first-class overloads, aka overloads-as-function-objec=
ts.<br></div><div class=3D"gmail_extra"><br clear=3D"all"><div>Mit freundli=
chen Gr=FC=DFen,<br>
<br>Martinho</div>
</div></div>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

--001a11332fea99521404de3e4a6b--

.


Author: nx02columbia@gmail.com
Date: Mon, 3 Jun 2013 06:32:40 -0700 (PDT)
Raw View
------=_Part_115_25408775.1370266360327
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

How often do you need comparison function more than once ?
Me prob <10% of cases...=20
that is why lambda would be nice...=20
that said I like your examples and insight, thank you for taking time to=20
write it.=20

On Friday, May 31, 2013 5:26:51 PM UTC+3, R. Martinho Fernandes wrote:
>
> I hope I am missing something here, because all this talk about lambdas a=
s=20
> template arguments improving usability sounds like nonsense to me. What c=
an=20
> you do with a lambda type that makes them so usable as template arguments=
?
>
> Without requiring lambda types to be default-constructible, I don't see=
=20
> how this makes anything more usable.
>
> using my_set =3D std::set<int, decltype([](int x, int y) { return f(x) <=
=20
> f(y); })>;
> my_set haha_nice_try; // nope, error
> my_set some_set([](int x, int y) { return f(x) < f(y); }); // erm, error!
> my_set some_other_set([](int x, int y) { return f(x) < f(y); }); // ok,=
=20
> let's assume at least lambdas identical character-by-character are the sa=
me=20
> type; then this works
>
> What? I have to repeat the function definition *everywhere*? And that=20
> doesn't work anyway? No, thanks.
> Of course, I can just declare the lambda as a global variable instead:
>
> auto comparison =3D [](int x, int y) { return f(x) < f(y); };
> using my_set =3D std::set<int, decltype(comparison)>;
> my_set haha_nice_try; // nope, still an error
> my_set some_set(comparison); // ok, now this works
> my_set some_other_set(comparison); // but don't you forget to pass the=20
> comparison along every single time lest you unless the compiler's wrath=
=20
> upon you!
>
> Stop it. This has no interesting advantage over using a function.
>
> bool comparison(int x, int y) { return f(x) < f(y); };
> using my_set =3D std::set<int, decltype(comparison)>;
> my_set haha_nice_try; // also an error!
> my_set some_set(comparison); // has always worked
> my_set some_other_set(comparison); // keep not forgetting it!
>
> Note how the comparison is not really entirely part of the set. You have=
=20
> to keep passing it along anytime you create one. That sucks.
>
> struct my_comparison {
>     bool operator()(int x, int y) { return f(x) < f(y); }
> };
>
> using my_set =3D std::set<int, my_comparison>;
> my_set haha_nice_try; // hey, it works
> my_set some_set(my_comparison{}); // you can, but why would you?
> my_set some_other_set;
>
> Note how the proposal to get lifted functions would also be cool here.
>
> bool comparison(int x, int y) { return f(x) < f(y); };
> using my_set =3D std::set<int, decltype([]comparison)>;
> my_set haha_nice_try;
> my_set some_set;
> my_set some_other_set; // all work fine
>
> Mit freundlichen Gr=FC=DFen,
>
> Martinho
>
>
> On Fri, May 31, 2013 at 3:12 PM, <nx02co...@gmail.com <javascript:>>wrote=
:
>
>> Hi,=20
>> I know reasons why lambdas cant be used as template arguments atm(lambda=
=20
>> is not a type, jada jada, decltype... -=20
>> http://stackoverflow.com/questions/5849059/lambda-expressions-as-class-t=
emplate-parameters)=20
>> ,
>>  but as a usability feature it would be a great addition to C++.
>> This way it is "unusable", aka it is simpler just to make a named=20
>> function.=20
>> --=20
>> =20
>> ---=20
>> You received this message because you are subscribed to the Google Group=
s=20
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n=20
>> email to std-proposal...@isocpp.org <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> Visit this group at=20
>> http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=3Den.
>> =20
>> =20
>>
>
>

--=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/?hl=3Den.



------=_Part_115_25408775.1370266360327
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

How often do you need comparison function more than once ?<br>Me prob &lt;1=
0% of cases... <br>that is why lambda would be nice... <br>that said I like=
 your examples and insight, thank you for taking time to write it. <br><br>=
On Friday, May 31, 2013 5:26:51 PM UTC+3, R. Martinho Fernandes wrote:<bloc=
kquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-l=
eft: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div><div><div>I h=
ope I am missing something here, because all this talk about lambdas as tem=
plate arguments improving usability sounds like nonsense to me. What can yo=
u do with a lambda type that makes them so usable as template arguments?<br=
>
<br>Without requiring lambda types to be default-constructible, I don't see=
 how this makes anything more usable.<br><br></div><span style=3D"font-fami=
ly:courier new,monospace">using my_set =3D std::set&lt;int, decltype([](int=
 x, int y) { return f(x) &lt; f(y); })&gt;;<br>
</span></div><span style=3D"font-family:courier new,monospace">my_set haha_=
nice_try; // nope, error<br>my_set some_set([](int x, int y) { return f(x) =
&lt; f(y); }); // erm, error!<br></span><div><span style=3D"font-family:cou=
rier new,monospace">my_set some_other_set([](int x, int y) { return f(x) &l=
t; f(y); }); // ok, let's assume at least lambdas identical character-by-ch=
aracter are the same type; then this works<br>
</span><div><br></div></div><div>What? I have to repeat the function defini=
tion *everywhere*? And that doesn't work anyway? No, thanks.<br></div><div>=
Of course, I can just declare the lambda as a global variable instead:<br>
<br><span style=3D"font-family:courier new,monospace">auto comparison =3D <=
/span><span style=3D"font-family:courier new,monospace"><span style=3D"font=
-family:courier new,monospace">[](int x, int y) { return f(x) &lt; f(y); };=
<br>
</span>using my_set =3D std::set&lt;int, decltype(comparison)&gt;;<br></spa=
n><span style=3D"font-family:courier new,monospace">my_set haha_nice_try; /=
/ nope, still an error<br>my_set some_set(comparison); // ok, now this work=
s<br>
</span><span style=3D"font-family:courier new,monospace">my_set
 some_other_set(</span><span style=3D"font-family:courier new,monospace"><s=
pan style=3D"font-family:courier new,monospace">comparison</span>); // but =
don't you forget to pass the comparison along every single time lest you un=
less the compiler's wrath upon you!</span><br>
<br></div><div>Stop it. This has no interesting advantage over using a func=
tion.<br><br><span style=3D"font-family:courier new,monospace">bool compari=
son</span><span style=3D"font-family:courier new,monospace"><span style=3D"=
font-family:courier new,monospace">(int x, int y) { return f(x) &lt; f(y); =
};<br>
</span>using my_set =3D std::set&lt;int, decltype(comparison)&gt;;<br></spa=
n><span style=3D"font-family:courier new,monospace">my_set haha_nice_try; /=
/ also an error!<br>my_set some_set(comparison); // has always worked<br></=
span><span style=3D"font-family:courier new,monospace">my_set
 some_other_set(</span><span style=3D"font-family:courier new,monospace"><s=
pan style=3D"font-family:courier new,monospace">comparison</span>); // keep=
 not forgetting it!</span><br></div><div><br></div><div>Note how the compar=
ison is not really entirely part of the set. You have to keep passing it al=
ong anytime you create one. That sucks.<br>
</div><div><br></div><div><span style=3D"font-family:courier new,monospace"=
>struct my_comparison {<br></span></div><div><span style=3D"font-family:cou=
rier new,monospace">&nbsp;&nbsp;&nbsp; bool operator()(int x, int y) { retu=
rn f(x) &lt; f(y); }<br>
</span></div><div><span style=3D"font-family:courier new,monospace">};<br><=
/span></div><div><div><span style=3D"font-family:courier new,monospace"><br=
></span></div><span style=3D"font-family:courier new,monospace">using my_se=
t =3D std::set&lt;int, my_comparison&gt;;<br>
</span><span style=3D"font-family:courier new,monospace">my_set haha_nice_t=
ry; // hey, it works<br>my_set some_set(my_comparison{}); // you can, but w=
hy would you?<br></span><span style=3D"font-family:courier new,monospace">m=
y_set some_other_set;</span><br>
<br><div><div></div><div>Note how the proposal to get lifted functions woul=
d also be cool here.<br></div><div><span style=3D"font-family:courier new,m=
onospace"><br>bool comparison</span><span style=3D"font-family:courier new,=
monospace"><span style=3D"font-family:courier new,monospace">(int x, int y)=
 { return f(x) &lt; f(y); };<br>
</span>using my_set =3D std::set&lt;int, decltype([]comparison)&gt;;<br></s=
pan><span style=3D"font-family:courier new,monospace">my_set haha_nice_try;=
<br>my_set some_set;<br></span><span style=3D"font-family:courier new,monos=
pace">my_set
 some_other_set</span><span style=3D"font-family:courier new,monospace">; /=
/ all work fine</span><br><br>Mit freundlichen Gr=FC=DFen,<br><br>Martinho<=
/div>
<br><br><div class=3D"gmail_quote">On Fri, May 31, 2013 at 3:12 PM,  <span =
dir=3D"ltr">&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-ma=
ilto=3D"mRuvNVBJy2oJ">nx02co...@gmail.com</a>&gt;</span> wrote:<br><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px=
 solid rgb(204,204,204);padding-left:1ex">
Hi, <br>I know reasons why lambdas cant be used as template arguments atm(l=
ambda is not a type, jada jada, decltype... - <a href=3D"http://stackoverfl=
ow.com/questions/5849059/lambda-expressions-as-class-template-parameters" t=
arget=3D"_blank">http://stackoverflow.com/<wbr>questions/5849059/lambda-<wb=
r>expressions-as-class-template-<wbr>parameters</a>) ,<br>
&nbsp;but as a usability feature it would be a great addition to C++.<br>Th=
is way it is "unusable", aka it is simpler just to make a named function. <=
br><span><font color=3D"#888888">



-- <br>
&nbsp;<br>
--- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
mRuvNVBJy2oJ">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"mRuvNVBJy2oJ">std-pr...@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den" target=3D"_blank">http://groups.google.com/a/<wbr>i=
socpp.org/group/std-<wbr>proposals/?hl=3Den</a>.<br>
&nbsp;<br>
&nbsp;<br>
</font></span></blockquote></div><br></div></div></div></div>
</blockquote>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_115_25408775.1370266360327--

.


Author: Mikhail Semenov <mikhailsemenov1957@gmail.com>
Date: Mon, 3 Jun 2013 19:37:34 +0100
Raw View
--089e0111b6aa0ffd3104de4442c9
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Martinho,

I am not aware of implementations that support even a single auto in a
lambda
[&](auto x){ };
GCC 4.8.0 and Visual C++ 2012 don't.

*C++11 does not supports "auto" in formal parameters (for functions or
lambdas).*

I am looking forward to using the N3649 features (Polymorphic Lambda).

As for 3617, I have to look at it more closely.

Regards,

Mikhail.


On 3 June 2013 12:30, Martinho Fernandes <martinho.fernandes@gmail.com>wrot=
e:

> On Mon, Jun 3, 2013 at 1:29 PM, Martinho Fernandes <
> martinho.fernandes@gmail.com> wrote:
>
>> What that code seems to need is N3617.
>>
>
> For clarity, what N3617 enables here is first-class overloads, aka
> overloads-as-function-objects.
>
> Mit freundlichen Gr=FC=DFen,
>
> Martinho
>
> --
>
> ---
> 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/?hl=3Den.
>
>
>

--=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/?hl=3Den.



--089e0111b6aa0ffd3104de4442c9
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Martinho,</div><div>=A0</div><div>I am not aware of i=
mplementations that support even a single auto in a lambda</div><div>[&amp;=
](auto x){ };</div><div>GCC 4.8.0 and Visual C++ 2012 don&#39;t.</div><div>=
=A0</div>
<div><strong>C++11 does not supports &quot;auto&quot; in formal parameters =
(for functions or lambdas).</strong></div><div>=A0</div><div>I am looking f=
orward to using the N3649 features (Polymorphic Lambda).</div><div>=A0</div=
>
<div>As for 3617, I have to look at it more closely.</div><div>=A0</div><di=
v>Regards,</div><div>=A0</div><div>Mikhail.</div></div><div class=3D"gmail_=
extra"><br><br><div class=3D"gmail_quote">On 3 June 2013 12:30, Martinho Fe=
rnandes <span dir=3D"ltr">&lt;<a href=3D"mailto:martinho.fernandes@gmail.co=
m" target=3D"_blank">martinho.fernandes@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"im"><div clas=
s=3D"gmail_extra"><div class=3D"gmail_quote">On Mon, Jun 3, 2013 at 1:29 PM=
, Martinho Fernandes <span dir=3D"ltr">&lt;<a href=3D"mailto:martinho.ferna=
ndes@gmail.com" target=3D"_blank">martinho.fernandes@gmail.com</a>&gt;</spa=
n> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;padding=
-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-l=
eft-style:solid"><div dir=3D"ltr"><div class=3D"gmail_quote"><div>What that=
 code seems to need is N3617.<br>
</div></div></div>

</blockquote></div><br></div></div><div class=3D"gmail_extra">For clarity, =
what N3617 enables here is first-class overloads, aka overloads-as-function=
-objects.<br></div><div class=3D"gmail_extra"><br clear=3D"all"><div>Mit fr=
eundlichen Gr=FC=DFen,<br>

<br>Martinho</div>
</div></div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

-- <br>
=A0<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%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den" target=3D"_blank">http://groups.google.com/a/isocpp=
..org/group/std-proposals/?hl=3Den</a>.<br>
=A0<br>
=A0<br>
</div></div></blockquote></div><br></div>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

--089e0111b6aa0ffd3104de4442c9--

.


Author: Richard Smith <richard@metafoo.co.uk>
Date: Mon, 3 Jun 2013 12:49:06 -0700
Raw View
--047d7b874bbee4ce4504de45419e
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Mon, Jun 3, 2013 at 11:37 AM, Mikhail Semenov <
mikhailsemenov1957@gmail.com> wrote:

> Martinho,
>
> I am not aware of implementations that support even a single auto in a
> lambda
> [&](auto x){ };
> GCC 4.8.0 and Visual C++ 2012 don't.
>

There's an implementation of an earlier revision of the generic lambdas
paper here:

https://github.com/faisalv/clang-glambda


> *C++11 does not supports "auto" in formal parameters (for functions or
> lambdas).*
>
> I am looking forward to using the N3649 features (Polymorphic Lambda).
>
> As for 3617, I have to look at it more closely.
>
> Regards,
>
> Mikhail.
>
>
> On 3 June 2013 12:30, Martinho Fernandes <martinho.fernandes@gmail.com>wr=
ote:
>
>> On Mon, Jun 3, 2013 at 1:29 PM, Martinho Fernandes <
>> martinho.fernandes@gmail.com> wrote:
>>
>>> What that code seems to need is N3617.
>>>
>>
>> For clarity, what N3617 enables here is first-class overloads, aka
>> overloads-as-function-objects.
>>
>> Mit freundlichen Gr=FC=DFen,
>>
>> Martinho
>>
>> --
>>
>> ---
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> 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/?hl=3Den.
>>
>>
>>
>
>  --
>
> ---
> 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/?hl=3Den.
>
>
>

--=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/?hl=3Den.



--047d7b874bbee4ce4504de45419e
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Mon, Jun 3, 2013 at 11:37 AM, Mikhail Semenov <span dir=3D"ltr">&lt;<a h=
ref=3D"mailto:mikhailsemenov1957@gmail.com" target=3D"_blank">mikhailsemeno=
v1957@gmail.com</a>&gt;</span> wrote:<br><div class=3D"gmail_quote"><blockq=
uote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc =
solid;padding-left:1ex">
<div dir=3D"ltr"><div>Martinho,</div><div>=A0</div><div>I am not aware of i=
mplementations that support even a single auto in a lambda</div><div>[&amp;=
](auto x){ };</div><div>GCC 4.8.0 and Visual C++ 2012 don&#39;t.</div></div=
>
</blockquote><div><br></div><div>There&#39;s an implementation of an earlie=
r revision of the generic lambdas paper here:</div><div><br></div><div><a h=
ref=3D"https://github.com/faisalv/clang-glambda">https://github.com/faisalv=
/clang-glambda</a><br>
</div><div>=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">
<div><strong>C++11 does not supports &quot;auto&quot; in formal parameters =
(for functions or lambdas).</strong></div><div>=A0</div><div>I am looking f=
orward to using the N3649 features (Polymorphic Lambda).</div><div>=A0</div=
>

<div>As for 3617, I have to look at it more closely.</div><div>=A0</div><di=
v>Regards,</div><span class=3D"HOEnZb"><font color=3D"#888888"><div>=A0</di=
v><div>Mikhail.</div></font></span></div><div class=3D"HOEnZb"><div class=
=3D"h5"><div class=3D"gmail_extra">
<br><br><div class=3D"gmail_quote">On 3 June 2013 12:30, Martinho Fernandes=
 <span dir=3D"ltr">&lt;<a href=3D"mailto:martinho.fernandes@gmail.com" targ=
et=3D"_blank">martinho.fernandes@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><div class=3D"gmail_ex=
tra"><div class=3D"gmail_quote">On Mon, Jun 3, 2013 at 1:29 PM, Martinho Fe=
rnandes <span dir=3D"ltr">&lt;<a href=3D"mailto:martinho.fernandes@gmail.co=
m" target=3D"_blank">martinho.fernandes@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;padding=
-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-l=
eft-style:solid"><div dir=3D"ltr"><div class=3D"gmail_quote"><div>What that=
 code seems to need is N3617.<br>

</div></div></div>

</blockquote></div><br></div></div><div class=3D"gmail_extra">For clarity, =
what N3617 enables here is first-class overloads, aka overloads-as-function=
-objects.<br></div><div class=3D"gmail_extra"><br clear=3D"all"><div>Mit fr=
eundlichen Gr=FC=DFen,<br>


<br>Martinho</div>
</div></div><div><div>

<p></p>

-- <br>
=A0<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%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den" target=3D"_blank">http://groups.google.com/a/isocpp=
..org/group/std-proposals/?hl=3Den</a>.<br>
=A0<br>
=A0<br>
</div></div></blockquote></div><br></div>

<p></p>

-- <br>
=A0<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%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den" target=3D"_blank">http://groups.google.com/a/isocpp=
..org/group/std-proposals/?hl=3Den</a>.<br>
=A0<br>
=A0<br>
</div></div></blockquote></div><br>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

--047d7b874bbee4ce4504de45419e--

.


Author: Mikhail Semenov <mikhailsemenov1957@gmail.com>
Date: Tue, 4 Jun 2013 10:58:15 -0700 (PDT)
Raw View
------=_Part_2868_29648877.1370368695107
Content-Type: text/plain; charset=ISO-8859-1


>
> Thank you, Richard.
>

--

---
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/?hl=en.



------=_Part_2868_29648877.1370368695107
Content-Type: text/html; charset=ISO-8859-1

<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;">Thank you, Richard.<br>
</blockquote>

<p></p>

-- <br />
&nbsp;<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 email to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href="http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en">http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en</a>.<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_2868_29648877.1370368695107--

.