summaryrefslogtreecommitdiffstats
path: root/styleguide
diff options
context:
space:
mode:
authorruuda <ruuda@google.com>2015-11-23 13:46:57 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-23 21:47:44 +0000
commitb425288a3f4168d1813d7c4db83de3c801cd9365 (patch)
tree61691b66a2be26ee937027f2aa10e0dfa94123cb /styleguide
parent97b9851546675bd7ccc4d1dfb48cddbf3502ca94 (diff)
downloadchromium_src-b425288a3f4168d1813d7c4db83de3c801cd9365.zip
chromium_src-b425288a3f4168d1813d7c4db83de3c801cd9365.tar.gz
chromium_src-b425288a3f4168d1813d7c4db83de3c801cd9365.tar.bz2
[StyleGuide] Allow begin and end non-member functions
Allow usage of |std::begin| and |std::end|. This is useful for iterating fixed-size arrays. Discussion thread: https://groups.google.com/a/chromium.org/d/topic/cxx/5iFNE8P5qT4/discussion Furthermore, this CL replaces home-brewn |std::end|-like functions in base/trace_event with |std::end| to verify that <iterator> is supported on all platforms. Review URL: https://codereview.chromium.org/1471683002 Cr-Commit-Position: refs/heads/master@{#361192}
Diffstat (limited to 'styleguide')
-rw-r--r--styleguide/c++/c++11.html24
1 files changed, 12 insertions, 12 deletions
diff --git a/styleguide/c++/c++11.html b/styleguide/c++/c++11.html
index 962de84..cc1bab3 100644
--- a/styleguide/c++/c++11.html
+++ b/styleguide/c++/c++11.html
@@ -298,6 +298,18 @@ Parameter pack</a></td>
</tr>
<tr>
+<td>Begin and End Non-Member Functions</td>
+<td><code>std::begin()</code> and <code>std::end()</code></td>
+<td>Allows use of free functions on any container, including
+fixed-size arrays</td>
+<td><a href="http://en.cppreference.com/w/cpp/iterator/begin">
+std::begin</a> and
+<a href="http://en.cppreference.com/w/cpp/iterator/end">
+std::end</a></td>
+<td>Useful for fixed-size arrays. <a href="https://groups.google.com/a/chromium.org/d/topic/cxx/5iFNE8P5qT4/discussion">Discussion thread</a></td>
+</tr>
+
+<tr>
<td>Containers containing movable types</td>
<td><code>vector&lt;scoped_ptr&gt;</code></td>
<td>Enables containers that contain move-only types like <code>scoped_ptr</code></td>
@@ -682,18 +694,6 @@ std::array</a></td>
</tr>
<tr>
-<td>Begin and End Non-Member Functions</td>
-<td><code>std::begin()</code> and <code>std::end()</code></td>
-<td>Allows use of free functions on any container, including
-built-in arrays</td>
-<td><a href="http://en.cppreference.com/w/cpp/iterator/begin">
-std::begin</a> and
-<a href="http://en.cppreference.com/w/cpp/iterator/end">
-std::end</a></td>
-<td>Useful for built-in arrays.</td>
-</tr>
-
-<tr>
<td>Bind Operations</td>
<td><code>std::bind(<i>function</i>, <i>args</i>, ...)</code></td>
<td>Declares a function object bound to certain arguments</td>