Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(744)

Unified Diff: styleguide/c++/c++11.html

Issue 1499293002: Move Rvalue references to the allowed section of the C++11 styleguide. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stylervalues: linky Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: styleguide/c++/c++11.html
diff --git a/styleguide/c++/c++11.html b/styleguide/c++/c++11.html
index daa43e23ca42e90752dc167521ba0f1d2ce11693..f3fcda61962cb6ed608eb8c7d4484386ab990cb0 100644
--- a/styleguide/c++/c++11.html
+++ b/styleguide/c++/c++11.html
@@ -245,6 +245,16 @@ Range-based for loop</a></td>
</tr>
<tr>
+<td>Rvalue References</td>
+<td><code>T(T&amp;&amp; t)</code> and <code>T&amp; operator=(T&amp;&amp; t)</code><br/>
+ <code>template <typename T>void Function(T&& t) { ... }</code></td>
+<td>Reference that only binds to a temporary object</td>
+<td><a href="http://en.cppreference.com/w/cpp/language/references#Rvalue_references">
+Rvalue references</a></td>
+<td>As per the <a href="https://google.github.io/styleguide/cppguide.html#Rvalue_references">Google style guide</a>: Only use these to define move constructors and move assignment operators, and for perfect forwarding.<br/>Most classes should not be copyable, even if movable. Continue to use DISALLOW_COPY_AND_ASSIGN (or DISALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND if needed) in most cases. <a href="https://groups.google.com/a/chromium.org/d/topic/chromium-dev/UnRaORb4TSw">Discussion thread</a> and <a href="https://groups.google.com/a/chromium.org/d/topic/cxx/Q526tkruXpM">discussion thread</a>.</td>
Nico 2015/12/07 19:00:35 Should we list the MSVC bugs we know about here to
danakj 2015/12/07 19:08:27 Done! (I only remember 2, do you remember more?)
+</tr>
+
+<tr>
<td>Standard Integers</td>
<td>Typedefs within <code>&lt;stdint.h&gt;</code>
and <code>&lt;inttypes&gt;</code></td>
@@ -340,7 +350,7 @@ std::end</a></td>
<td>Facilitates efficient move operations</td>
<td><a href="http://en.cppreference.com/w/cpp/utility/move">
<code>std::move</code> reference</a></td>
-<td>Note: std::move() is allowed but writing your own move constructors is still only allowed in exceptional cases for now, see 'Rvalue References (and Move Semantics)'. <a href='https://groups.google.com/a/chromium.org/forum/#!topic/cxx/x_dWFxJFdbM'>Discussion thread</a></td>
+<td><a href='https://groups.google.com/a/chromium.org/forum/#!topic/cxx/x_dWFxJFdbM'>Discussion thread</a></td>
</tr>
<tr>
@@ -458,15 +468,6 @@ string literal</a></td>
</tr>
<tr>
-<td>Rvalue References (and Move Semantics)</td>
-<td><code>T(T&amp;&amp; t)</code> and <code>T&amp; operator=(T&amp;&amp; t)</code></td>
-<td>Reference that only binds to a temporary object</td>
-<td><a href="http://en.cppreference.com/w/cpp/language/references#Rvalue_references">
-Rvalue references</a></td>
-<td>To be revisited in the future. Allowed in exceptional cases where approved by the OWNERS of src/styleguide/c++/. <a href="https://groups.google.com/a/chromium.org/d/topic/chromium-dev/UnRaORb4TSw">Discussion thread</a></td>
-</tr>
-
-<tr>
<td>(Uniform) Initialization Syntax</td>
<td><code><i>type</i> <i>name</i> { [<i>value</i> ..., <i>value</i>]};</code></td>
<td>Allows any object of primitive, aggregate or class
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698