Commit 9cd73b92 authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Allow generic ("polymorphic") lambdas.

BUG=none
TEST=none

Change-Id: If0c65e7139facaa72f19a92e41939dd82646839e
Reviewed-on: https://chromium-review.googlesource.com/855776Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547085}
parent d6021f65
......@@ -554,8 +554,7 @@ bool operator==(const Value& lhs, const Value& rhs) {
return false;
return std::equal(std::begin(lhs.dict_), std::end(lhs.dict_),
std::begin(rhs.dict_),
[](const Value::DictStorage::value_type& u,
const Value::DictStorage::value_type& v) {
[](const auto& u, const auto& v) {
return std::tie(u.first, *u.second) ==
std::tie(v.first, *v.second);
});
......
......@@ -400,6 +400,14 @@ template &lt;typename T&gt;<br/>void Function(T&amp;&amp; t) { ... }</code></td>
<td><a href="https://groups.google.com/a/chromium.org/d/topic/cxx/exS1aGs1wes/discussion">Discussion thread</a></td>
</tr>
<tr>
<td>Generic lambdas</td>
<td><code>[](const auto&amp; x) { <i>...</i> }</code></td>
<td>Allows lambda argument types to be deduced using <code>auto</code> (according to the rules that apply to templates).</td>
<td><a href="http://en.cppreference.com/w/cpp/language/lambda">lambda expressions</a></td>
<td><a href="https://groups.google.com/a/chromium.org/d/topic/cxx/LasGKwE3SFM/discussion">Discussion thread</a></td>
</tr>
<tr>
<td>Relaxed constant expressions</td>
<td><code>constexpr int Factorial(int n) {<br>&nbsp;&nbsp;int result = 1;<br>&nbsp;&nbsp;while (n > 0)<br>&nbsp;&nbsp;&nbsp;&nbsp;result *= n--;<br>&nbsp;&nbsp;return result;<br>}</code></td>
......@@ -782,14 +790,6 @@ std::move(t).f();&nbsp;&nbsp;// second</code></td>
<td>Temporarily banned since it <a href="https://bugs.llvm.org/show_bug.cgi?id=34185">can cause infinite loops in clang</a>. We expect to allow this once that bug is fixed. Usage should be rare, primarily for abstract template code. <a href="https://groups.google.com/a/chromium.org/d/topic/cxx/-Ox7YgRS_no/discussion">Discussion thread</a></td>
</tr>
<tr>
<td>Generic lambdas</td>
<td><code>[](const auto&amp; x) { <i>...</i> }</code></td>
<td>Allows lambda argument types to be deduced using <code>auto</code> (according to the rules that apply to templates).</td>
<td><a href="http://en.cppreference.com/w/cpp/language/lambda">lambda expressions</a></td>
<td>Temporarily banned since it <a href="https://bugs.llvm.org/show_bug.cgi?id=33561">can cause infinite loops in clang</a>. We expect to allow this once that bug is fixed. <a href="https://chromium-review.googlesource.com/#/c/chromium/src/+/855776">Discussion thread</a></td>
</tr>
</tbody>
</table>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment