tag:blogger.com,1999:blog-8638474063464489651.post8358446638146940397..comments2024-01-15T11:38:29.051-08:00Comments on Multi-paradigm: Clang and Generic (Polymorphic) Lambdas.Splinter of Chaoshttp://www.blogger.com/profile/14715348728512729776noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-8638474063464489651.post-41873906579903028952012-12-29T06:12:19.006-08:002012-12-29T06:12:19.006-08:00I should mention this somewhere in the article as ...I should mention this somewhere in the article as well.<br /><br />Section <b>2.1</b> of the proposal talks about this, but it is not implemented in the patch. Consider the following:<br /><br /><i>auto f = [](x) ...; // auto-typed x.<br />auto g = [](std::string) ...; // unnamed parameter.<br /><br />struct x {};<br />auto h = [](x) ...; // what now?</i><br /><br />I think getting rid of <i>auto</i> is going one step too far, but I've also seen several, casual, suggestions in the google groups discussion: https://groups.google.com/a/isocpp.org/forum/#!topic/std-discussion/Xck6f50kOjU<br /><br /><i>auto f = [](+x) ...; // auto-deduced x<br />auto g = [] expr( @x ); // x is an implicit parameter.<br />auto h = [] expr( _1 ); // Same as g.<br />auto k = []f; // where []f refers to the overload set of f.<br />...</i><br /><br />So there is no real agreement on what solution is best. That's why I think it's important for us to take advantage of the open standardization process. Splinter of Chaoshttps://www.blogger.com/profile/14715348728512729776noreply@blogger.comtag:blogger.com,1999:blog-8638474063464489651.post-62012920373247331802012-12-29T03:07:18.609-08:002012-12-29T03:07:18.609-08:00is it possible to write
auto add = [](x, y) x + y...is it possible to write<br /> auto add = [](x, y) x + y;<br />instead of <br /> auto add = [](auto x, auto y) x + y;<br />?Anonymousnoreply@blogger.com