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

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

Issue 1855113002: Move std::unique_ptr to the C++11 allowed library features section. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | no next file » | 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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 <code>is_const</code>, <code>is_pod</code>, <code>is_unsigned</code><br/> 461 <code>is_const</code>, <code>is_pod</code>, <code>is_unsigned</code><br/>
462 <code>is_default_constructible</code>, <code>is_move_constructible</code>, <code >is_copy_assignable</code><br/> 462 <code>is_default_constructible</code>, <code>is_move_constructible</code>, <code >is_copy_assignable</code><br/>
463 <code>enable_if</code>, <code>conditional</code>, <code>result_of</code><br/> 463 <code>enable_if</code>, <code>conditional</code>, <code>result_of</code><br/>
464 </td> 464 </td>
465 <td>Allows compile-time inspection of the properties of types</td> 465 <td>Allows compile-time inspection of the properties of types</td>
466 <td><a href="http://en.cppreference.com/w/cpp/header/type_traits">&lt;type_trait s&gt;</a></td> 466 <td><a href="http://en.cppreference.com/w/cpp/header/type_traits">&lt;type_trait s&gt;</a></td>
467 <td>Note that not all type traits are available on all platforms (eg std::underl ying_type doesn't work in libstdc++4.6). Use judiciously. <a href='https://group s.google.com/a/chromium.org/forum/#!topic/cxx/vCxo4tZNd_M'>Discussion thread</a> </td> 467 <td>Note that not all type traits are available on all platforms (eg std::underl ying_type doesn't work in libstdc++4.6). Use judiciously. <a href='https://group s.google.com/a/chromium.org/forum/#!topic/cxx/vCxo4tZNd_M'>Discussion thread</a> </td>
468 </tr> 468 </tr>
469 469
470 <tr> 470 <tr>
471 <td>Tuples</td>
472 <td><code>std::tuple</code></td>
473 <td>A fixed-size ordered collection of values of mixed types</td>
474 <td><a href="http://en.cppreference.com/w/cpp/utility/tuple">std::tuple</a></td>
475 <td><a href="https://crbug.com/554987">Tracking bug</a> to plan moving from <cod e>base::Tuple</code> to <code>std::tuple</code>. See also <code>std::tie</code>.
476 <code>base::Tuple</code> is now an alias for <code>std::tuple</code>. In class t emplate specializations, use <code>std::tuple</code> instead of <code>base::Tupl e</code> to work around a MSVS2013 internal compiler error (Error code: C1001).
477 </td>
478 </tr>
479
480 <tr>
471 <td>Unordered Associative Containers</td> 481 <td>Unordered Associative Containers</td>
472 <td><code>std::unordered_set</code>, <code>std::unordered_map</code>, 482 <td><code>std::unordered_set</code>, <code>std::unordered_map</code>,
473 <code>std::unordered_multiset</code>, and <code>std::unordered_multimap</code></ td> 483 <code>std::unordered_multiset</code>, and <code>std::unordered_multimap</code></ td>
474 <td>Allows efficient containers of key/value pairs</td> 484 <td>Allows efficient containers of key/value pairs</td>
475 <td><a href="http://en.cppreference.com/w/cpp/container/unordered_map">std::unor dered_map</a> 485 <td><a href="http://en.cppreference.com/w/cpp/container/unordered_map">std::unor dered_map</a>
476 and <a href="http://en.cppreference.com/w/cpp/container/unordered_set">std::unor dered_set</a> 486 and <a href="http://en.cppreference.com/w/cpp/container/unordered_set">std::unor dered_set</a>
477 </td> 487 </td>
478 <td>Per the <a href="https://google.github.io/styleguide/cppguide.html#std_hash" >Google style guide</a>, specify custom hashers instead of specializing <code>st d::hash</code> for custom types. <a href="https://groups.google.com/a/chromium.o rg/forum/#!topic/cxx/nCdjQqnouO4">Discussion thread</a>.</td> 488 <td>Per the <a href="https://google.github.io/styleguide/cppguide.html#std_hash" >Google style guide</a>, specify custom hashers instead of specializing <code>st d::hash</code> for custom types. <a href="https://groups.google.com/a/chromium.o rg/forum/#!topic/cxx/nCdjQqnouO4">Discussion thread</a>.</td>
479 </tr> 489 </tr>
480 490
481 <tr> 491 <tr>
482 <td>Tuples</td> 492 <td>Unique Pointers</td>
483 <td><code>std::tuple</code></td> 493 <td><code>std::unique_ptr&lt;<i>type</i>&gt;</code></td>
484 <td>A fixed-size ordered collection of values of mixed types</td> 494 <td>A smart pointer with sole ownership of the owned object.</td>
485 <td><a href="http://en.cppreference.com/w/cpp/utility/tuple">std::tuple</a></td> 495 <td><a href="http://en.cppreference.com/w/cpp/memory/unique_ptr">std::unique_ptr </a></td>
486 <td><a href="https://crbug.com/554987">Tracking bug</a> to plan moving from <cod e>base::Tuple</code> to <code>std::tuple</code>. See also <code>std::tie</code>. 496 <td>Google style guide: <a href="https://google.github.io/styleguide/cppguide.ht ml#Ownership_and_Smart_Pointers">Ownership and Smart Pointers</a>. <a href="http s://groups.google.com/a/chromium.org/d/msg/cxx/aT2wsBLKvzI/oZuZ718oAwAJ">Discuss ion thread</a>. Use in all newly written code. scoped_ptr is a <a href="https:// groups.google.com/a/chromium.org/d/msg/chromium-dev/roY78iTblYc/bb8nYsxfCgAJ">ty pedef for std::unique_ptr</a> and is going away shortly.</td>
487 <code>base::Tuple</code> is now an alias for <code>std::tuple</code>. In class t emplate specializations, use <code>std::tuple</code> instead of <code>base::Tupl e</code> to work around a MSVS2013 internal compiler error (Error code: C1001).
488 </td>
489 </tr> 497 </tr>
490 498
491 </tbody> 499 </tbody>
492 </table> 500 </table>
493 501
494 <h2 id="blacklist">C++11 Blacklist (Disallowed and Banned Features)</h2> 502 <h2 id="blacklist">C++11 Blacklist (Disallowed and Banned Features)</h2>
495 503
496 <p>This section lists features that are not allowed to be used yet. 504 <p>This section lists features that are not allowed to be used yet.
497 505
498 <h3 id="blacklist_banned"><a name="core-blacklist"></a>C++11 Banned Features</h3 > 506 <h3 id="blacklist_banned"><a name="core-blacklist"></a>C++11 Banned Features</h3 >
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 <td><a href="http://en.cppreference.com/w/cpp/types/type_index"> 1061 <td><a href="http://en.cppreference.com/w/cpp/types/type_index">
1054 std::type_index</a> and 1062 std::type_index</a> and
1055 <a href="http://en.cppreference.com/w/cpp/types/type_info/hash_code"> 1063 <a href="http://en.cppreference.com/w/cpp/types/type_info/hash_code">
1056 std::type_info::hash_code</a></td> 1064 std::type_info::hash_code</a></td>
1057 <td><code>std::type_index</code> is a thin wrapper for 1065 <td><code>std::type_index</code> is a thin wrapper for
1058 <code>std::type_info</code>, allowing you to use it directly 1066 <code>std::type_info</code>, allowing you to use it directly
1059 within both associative and unordered containers</td> 1067 within both associative and unordered containers</td>
1060 </tr> 1068 </tr>
1061 1069
1062 <tr> 1070 <tr>
1063 <td>Unique Pointers</td>
1064 <td><code>std::unique_ptr&lt;<i>type</i>&gt;</code></td>
1065 <td>Defines a pointer with clear and unambiguous ownership</td>
1066 <td>TODO: documentation link</td>
1067 <td><a href="https://google.github.io/styleguide/cppguide.html#Ownership_and_Sma rt_Pointers">
1068 Ownership and Smart Pointers</a></td>
1069 </tr>
1070
1071 <tr>
1072 <td>Variadic Copy Macro</td> 1071 <td>Variadic Copy Macro</td>
1073 <td><code>va_copy(va_list <i>dest</i>, va_list <i>src</i>)</code></td> 1072 <td><code>va_copy(va_list <i>dest</i>, va_list <i>src</i>)</code></td>
1074 <td>Makes a copy of the variadic function arguments</td> 1073 <td>Makes a copy of the variadic function arguments</td>
1075 <td></td> 1074 <td></td>
1076 <td></td> 1075 <td></td>
1077 </tr> 1076 </tr>
1078 1077
1079 <tr> 1078 <tr>
1080 <td>Weak Pointers</td> 1079 <td>Weak Pointers</td>
1081 <td><code>std::weak_ptr</code></td> 1080 <td><code>std::weak_ptr</code></td>
(...skipping 27 matching lines...) Expand all
1109 C++ Style Guide</a>. However, may be useful for 1108 C++ Style Guide</a>. However, may be useful for
1110 consuming non-ASCII data.</td> 1109 consuming non-ASCII data.</td>
1111 </tr> 1110 </tr>
1112 1111
1113 </tbody> 1112 </tbody>
1114 </table> 1113 </table>
1115 1114
1116 </div> 1115 </div>
1117 </body> 1116 </body>
1118 </html> 1117 </html>
OLDNEW
« 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