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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/callback_internal.h ('k') | 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 42cdc7a456daf865a2356c20141a7c2e4cf7a074..a5565013a3bb64264434efe93f447ea8d8695d3f 100644
--- a/styleguide/c++/c++11.html
+++ b/styleguide/c++/c++11.html
@@ -298,6 +298,26 @@ Parameter pack</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>
</tr>
+<tr>
+<td>Conditional Type Selection</td>
+<td><code>std::enable_if</code> and <code>std::conditional</code></td>
+<td>Enables compile-time conditional type selection</td>
+<td><a href="http://en.cppreference.com/w/cpp/types/enable_if">
+std::enable_if</a> and
+<a href="http://en.cppreference.com/w/cpp/types/conditional">
+conditional</a></td>
+<td>Usage should be rare.<a href='https://groups.google.com/a/chromium.org/forum/#!topic/cxx/vCxo4tZNd_M'>Discussion thread</a></td>
+</tr>
+
+<tr>
+<td>Type Traits</td>
+<td>Class templates within <code>&lt;type_traits&gt;</code></td>
+<td>Allows compile-time inspection of the properties of types</td>
+<td><a href="http://en.cppreference.com/w/cpp/header/type_traits">
+Standard library header &lt;type_traits&gt;</a></td>
+<td>Note that not all type traits are available on all platforms (eg std::underlying_type doesn't work in libstdc++4.6). Use judiciously. <a href='https://groups.google.com/a/chromium.org/forum/#!topic/cxx/vCxo4tZNd_M'>Discussion thread</a></td>
+</tr>
+
</tbody>
</table>
@@ -676,17 +696,6 @@ the <code>&lt;complex&gt;</code> library.</td>
</tr>
<tr>
-<td>Conditional Type Selection</td>
-<td><code>std::enable_if</code> and <code>std::conditional</code></td>
-<td>Enables compile-time conditional type selection</td>
-<td><a href="http://en.cppreference.com/w/cpp/types/enable_if">
-std::enable_if</a> and
-<a href="http://en.cppreference.com/w/cpp/types/conditional">
-conditional</a></td>
-<td></td>
-</tr>
-
-<tr>
<td>Constant Iterator Methods on Containers</td>
<td><code>std::cbegin()</code> and <code>std::cend()</code></td>
<td>Enforces iteration methods that don't change container contents</td>
@@ -966,15 +975,6 @@ within both associative and unordered containers</td>
</tr>
<tr>
-<td>Type Traits</td>
-<td>Class templates within <code>&lt;type_traits&gt;</code></td>
-<td>Allows compile-time inspection of the properties of types</td>
-<td><a href="http://en.cppreference.com/w/cpp/header/type_traits">
-Standard library header &lt;type_traits&gt;</a></td>
-<td></td>
-</tr>
-
-<tr>
<td>Unique Pointers</td>
<td><code>std::unique_ptr&lt;<i>type</i>&gt;</code></td>
<td>Defines a pointer with clear and unambiguous ownership</td>
« 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