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

Side by Side Diff: styleguide/c++/c++11.html

Issue 2047633002: Revert of Remove base/move.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months 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 unified diff | Download patch
« no previous file with comments | « storage/browser/blob/scoped_file.h ('k') | ui/gl/android/scoped_java_surface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright 2014 The Chromium Authors. All rights reserved. 3 Copyright 2014 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 <html> 7 <html>
8 <head> 8 <head>
9 <meta charset="utf-8"> 9 <meta charset="utf-8">
10 <title>C++11 use in Chromium</title> 10 <title>C++11 use in Chromium</title>
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 <td><a href="http://en.cppreference.com/w/cpp/language/range-for">Range-based fo r loop</a></td> 233 <td><a href="http://en.cppreference.com/w/cpp/language/range-for">Range-based fo r loop</a></td>
234 <td>As a rule of thumb, use <code>for (const auto& ...)</code>, <code>for (auto& ...)</code>, or <code>for (<i>concrete type</i> ...)</code>. For pointers, use <code>for (auto* ...)</code> to make clear that the copy of the loop variable is intended, and only a pointer is copied. <a href="https://groups.google.com/a/ch romium.org/forum/#!topic/chromium-dev/hpzz4EqbVmc">Discussion thread</a></td> 234 <td>As a rule of thumb, use <code>for (const auto& ...)</code>, <code>for (auto& ...)</code>, or <code>for (<i>concrete type</i> ...)</code>. For pointers, use <code>for (auto* ...)</code> to make clear that the copy of the loop variable is intended, and only a pointer is copied. <a href="https://groups.google.com/a/ch romium.org/forum/#!topic/chromium-dev/hpzz4EqbVmc">Discussion thread</a></td>
235 </tr> 235 </tr>
236 236
237 <tr> 237 <tr>
238 <td>Rvalue References</td> 238 <td>Rvalue References</td>
239 <td><code>T(T&amp;&amp; t)</code> and <code>T&amp; operator=(T&amp;&amp; t)<br/> <br/> 239 <td><code>T(T&amp;&amp; t)</code> and <code>T&amp; operator=(T&amp;&amp; t)<br/> <br/>
240 template &lt;typename T&gt;<br/>void Function(T&& t) { ... }</code></td> 240 template &lt;typename T&gt;<br/>void Function(T&& t) { ... }</code></td>
241 <td>Reference that only binds to a temporary object</td> 241 <td>Reference that only binds to a temporary object</td>
242 <td><a href="http://en.cppreference.com/w/cpp/language/references#Rvalue_referen ces">Rvalue references</a></td> 242 <td><a href="http://en.cppreference.com/w/cpp/language/references#Rvalue_referen ces">Rvalue references</a></td>
243 <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. Most classes should n ot be copyable, even if movable. Continue to use DISALLOW_COPY_AND_ASSIGN in mos t cases. <a href="https://groups.google.com/a/chromium.org/d/topic/chromium-dev/ UnRaORb4TSw">Discussion thread</a>. <a href="https://groups.google.com/a/chromiu m.org/d/topic/cxx/Q526tkruXpM">Another discussion thread</a>.</td> 243 <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. Most classes should n ot be copyable, even if movable. Continue to use DISALLOW_COPY_AND_ASSIGN (or DI SALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND if needed) in most cases. <a href="htt ps://groups.google.com/a/chromium.org/d/topic/chromium-dev/UnRaORb4TSw">Discussi on thread</a>. <a href="https://groups.google.com/a/chromium.org/d/topic/cxx/Q52 6tkruXpM">Another discussion thread</a>.</td>
244 </tr> 244 </tr>
245 245
246 <tr> 246 <tr>
247 <td>Standard Integers</td> 247 <td>Standard Integers</td>
248 <td>Typedefs within <code>&lt;stdint.h&gt;</code> and <code>&lt;inttypes&gt;</co de></td> 248 <td>Typedefs within <code>&lt;stdint.h&gt;</code> and <code>&lt;inttypes&gt;</co de></td>
249 <td>Provides fixed-size integers independent of platforms</td> 249 <td>Provides fixed-size integers independent of platforms</td>
250 <td><a href="http://www.cplusplus.com/reference/cstdint/">&lt;stdint.h&gt; (cstd int)</a></td> 250 <td><a href="http://www.cplusplus.com/reference/cstdint/">&lt;stdint.h&gt; (cstd int)</a></td>
251 <td>Already in common use in the codebase. Approved without discussion.</td> 251 <td>Already in common use in the codebase. Approved without discussion.</td>
252 </tr> 252 </tr>
253 253
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 <td><a href="http://en.cppreference.com/w/cpp/locale/wstring_convert">std::wstri ng_convert</a>, <a href="http://en.cppreference.com/w/cpp/locale/wbuffer_convert ">std::wbuffer_convert</a>, <a href="http://en.cppreference.com/w/cpp/locale/cod ecvt_utf8">std::codecvt_utf8</a>, <a href="http://en.cppreference.com/w/cpp/loca le/codecvt_utf16">std::codecvt_utf16</a>, <a href="http://en.cppreference.com/w/ cpp/locale/codecvt_utf8_utf16">std::codecvt_utf8_utf16</a></td> 917 <td><a href="http://en.cppreference.com/w/cpp/locale/wstring_convert">std::wstri ng_convert</a>, <a href="http://en.cppreference.com/w/cpp/locale/wbuffer_convert ">std::wbuffer_convert</a>, <a href="http://en.cppreference.com/w/cpp/locale/cod ecvt_utf8">std::codecvt_utf8</a>, <a href="http://en.cppreference.com/w/cpp/loca le/codecvt_utf16">std::codecvt_utf16</a>, <a href="http://en.cppreference.com/w/ cpp/locale/codecvt_utf8_utf16">std::codecvt_utf8_utf16</a></td>
918 <td>Non-UTF-8 text is banned by the <a href="https://google.github.io/styleguide /cppguide.html#Non-ASCII_Characters">Google Style Guide</a>. However, may be use ful for consuming non-ASCII data.</td> 918 <td>Non-UTF-8 text is banned by the <a href="https://google.github.io/styleguide /cppguide.html#Non-ASCII_Characters">Google Style Guide</a>. However, may be use ful for consuming non-ASCII data.</td>
919 </tr> 919 </tr>
920 920
921 </tbody> 921 </tbody>
922 </table> 922 </table>
923 923
924 </div> 924 </div>
925 </body> 925 </body>
926 </html> 926 </html>
OLDNEW
« no previous file with comments | « storage/browser/blob/scoped_file.h ('k') | ui/gl/android/scoped_java_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698