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

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

Issue 1457673002: styleguide: Allow enable_if, conditional, and other type_traits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rare usage note Created 5 years, 1 month 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 | « base/callback_internal.h ('k') | 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 291
292 <tr> 292 <tr>
293 <td>Move Semantics</td> 293 <td>Move Semantics</td>
294 <td><code>std::move()</code></td> 294 <td><code>std::move()</code></td>
295 <td>Facilitates efficient move operations</td> 295 <td>Facilitates efficient move operations</td>
296 <td><a href="http://en.cppreference.com/w/cpp/utility/move"> 296 <td><a href="http://en.cppreference.com/w/cpp/utility/move">
297 <code>std::move</code> reference</a></td> 297 <code>std::move</code> reference</a></td>
298 <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 Sem antics)'. <a href='https://groups.google.com/a/chromium.org/forum/#!topic/cxx/x_ dWFxJFdbM'>Discussion thread</a></td> 298 <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 Sem antics)'. <a href='https://groups.google.com/a/chromium.org/forum/#!topic/cxx/x_ dWFxJFdbM'>Discussion thread</a></td>
299 </tr> 299 </tr>
300 300
301 <tr>
302 <td>Conditional Type Selection</td>
303 <td><code>std::enable_if</code> and <code>std::conditional</code></td>
304 <td>Enables compile-time conditional type selection</td>
305 <td><a href="http://en.cppreference.com/w/cpp/types/enable_if">
306 std::enable_if</a> and
307 <a href="http://en.cppreference.com/w/cpp/types/conditional">
308 conditional</a></td>
309 <td>Usage should be rare.<a href='https://groups.google.com/a/chromium.org/forum /#!topic/cxx/vCxo4tZNd_M'>Discussion thread</a></td>
310 </tr>
311
312 <tr>
313 <td>Type Traits</td>
314 <td>Class templates within <code>&lt;type_traits&gt;</code></td>
315 <td>Allows compile-time inspection of the properties of types</td>
316 <td><a href="http://en.cppreference.com/w/cpp/header/type_traits">
317 Standard library header &lt;type_traits&gt;</a></td>
318 <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>
319 </tr>
320
301 </tbody> 321 </tbody>
302 </table> 322 </table>
303 323
304 <h2 id="blacklist">C++11 Blacklist (Disallowed and Banned Features)</h2> 324 <h2 id="blacklist">C++11 Blacklist (Disallowed and Banned Features)</h2>
305 325
306 <p>This section lists features that are not allowed to be used yet. 326 <p>This section lists features that are not allowed to be used yet.
307 327
308 <h3 id="blacklist_banned">C++11 Banned Features</h3> 328 <h3 id="blacklist_banned">C++11 Banned Features</h3>
309 329
310 <p>This section lists C++11 features that are not allowed in the Chromium 330 <p>This section lists C++11 features that are not allowed in the Chromium
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 <tr> 689 <tr>
670 <td>Complex Inverse Trigonometric and Hyperbolic Functions</td> 690 <td>Complex Inverse Trigonometric and Hyperbolic Functions</td>
671 <td>Functions within <code>&lt;complex&gt;</code></td> 691 <td>Functions within <code>&lt;complex&gt;</code></td>
672 <td>Adds inverse trigonomentric and hyperbolic non-member functions to 692 <td>Adds inverse trigonomentric and hyperbolic non-member functions to
673 the <code>&lt;complex&gt;</code> library.</td> 693 the <code>&lt;complex&gt;</code> library.</td>
674 <td><a href="http://en.cppreference.com/w/cpp/numeric/complex">std::complex</a>< /td> 694 <td><a href="http://en.cppreference.com/w/cpp/numeric/complex">std::complex</a>< /td>
675 <td></td> 695 <td></td>
676 </tr> 696 </tr>
677 697
678 <tr> 698 <tr>
679 <td>Conditional Type Selection</td>
680 <td><code>std::enable_if</code> and <code>std::conditional</code></td>
681 <td>Enables compile-time conditional type selection</td>
682 <td><a href="http://en.cppreference.com/w/cpp/types/enable_if">
683 std::enable_if</a> and
684 <a href="http://en.cppreference.com/w/cpp/types/conditional">
685 conditional</a></td>
686 <td></td>
687 </tr>
688
689 <tr>
690 <td>Constant Iterator Methods on Containers</td> 699 <td>Constant Iterator Methods on Containers</td>
691 <td><code>std::cbegin()</code> and <code>std::cend()</code></td> 700 <td><code>std::cbegin()</code> and <code>std::cend()</code></td>
692 <td>Enforces iteration methods that don't change container contents</td> 701 <td>Enforces iteration methods that don't change container contents</td>
693 <td>TODO: documentation link</td> 702 <td>TODO: documentation link</td>
694 <td></td> 703 <td></td>
695 </tr> 704 </tr>
696 705
697 <tr> 706 <tr>
698 <td>Construct Elements in Containers</td> 707 <td>Construct Elements in Containers</td>
699 <td><code>emplace()</code>,<code>emplace_back()</code>, 708 <td><code>emplace()</code>,<code>emplace_back()</code>,
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 <td><a href="http://en.cppreference.com/w/cpp/types/type_index"> 968 <td><a href="http://en.cppreference.com/w/cpp/types/type_index">
960 std::type_index</a> and 969 std::type_index</a> and
961 <a href="http://en.cppreference.com/w/cpp/types/type_info/hash_code"> 970 <a href="http://en.cppreference.com/w/cpp/types/type_info/hash_code">
962 std::type_info::hash_code</a></td> 971 std::type_info::hash_code</a></td>
963 <td><code>std::type_index</code> is a thin wrapper for 972 <td><code>std::type_index</code> is a thin wrapper for
964 <code>std::type_info</code>, allowing you to use it directly 973 <code>std::type_info</code>, allowing you to use it directly
965 within both associative and unordered containers</td> 974 within both associative and unordered containers</td>
966 </tr> 975 </tr>
967 976
968 <tr> 977 <tr>
969 <td>Type Traits</td>
970 <td>Class templates within <code>&lt;type_traits&gt;</code></td>
971 <td>Allows compile-time inspection of the properties of types</td>
972 <td><a href="http://en.cppreference.com/w/cpp/header/type_traits">
973 Standard library header &lt;type_traits&gt;</a></td>
974 <td></td>
975 </tr>
976
977 <tr>
978 <td>Unique Pointers</td> 978 <td>Unique Pointers</td>
979 <td><code>std::unique_ptr&lt;<i>type</i>&gt;</code></td> 979 <td><code>std::unique_ptr&lt;<i>type</i>&gt;</code></td>
980 <td>Defines a pointer with clear and unambiguous ownership</td> 980 <td>Defines a pointer with clear and unambiguous ownership</td>
981 <td>TODO: documentation link</td> 981 <td>TODO: documentation link</td>
982 <td><a href="https://google.github.io/styleguide/cppguide.html#Ownership_and_Sma rt_Pointers"> 982 <td><a href="https://google.github.io/styleguide/cppguide.html#Ownership_and_Sma rt_Pointers">
983 Ownership and Smart Pointers</a></td> 983 Ownership and Smart Pointers</a></td>
984 </tr> 984 </tr>
985 985
986 <tr> 986 <tr>
987 <td>Unordered Associative Containers</td> 987 <td>Unordered Associative Containers</td>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 C++ Style Guide</a>. However, may be useful for 1035 C++ Style Guide</a>. However, may be useful for
1036 consuming non-ASCII data.</td> 1036 consuming non-ASCII data.</td>
1037 </tr> 1037 </tr>
1038 1038
1039 </tbody> 1039 </tbody>
1040 </table> 1040 </table>
1041 1041
1042 </div> 1042 </div>
1043 </body> 1043 </body>
1044 </html> 1044 </html>
OLDNEW
« no previous file with comments | « base/callback_internal.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698