Chromium Code Reviews| 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&& t)</code> and <code>T& operator=(T&& 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><stdint.h></code> |
| and <code><inttypes></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&& t)</code> and <code>T& operator=(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>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 |