Index: styleguide/c++/c++11.html |
diff --git a/styleguide/c++/c++11.html b/styleguide/c++/c++11.html |
index 239a282a13626484e39051dbe752e4fd6c3fd2e0..27d37b6c5a222caf5c4c9f6de02b4fd1161c0a30 100644 |
--- a/styleguide/c++/c++11.html |
+++ b/styleguide/c++/c++11.html |
@@ -357,13 +357,10 @@ Note that <algorithm> contains a range-based <code>move</code> method. Th |
<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> |
+<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><br> |
+Note that non-member <code>cbegin()</code> and <code>cend()</code> are not available until C++14.</td> |
</tr> |
<tr> |
@@ -375,6 +372,14 @@ std::end</a></td> |
</tr> |
<tr> |
+<td>Constant Iterator Methods on Containers</td> |
+<td><code>std::vector::cbegin()</code>, <code>std::vector::cend()</code></td> |
+<td>Allows more widespread use of <code>const_iterator</code></td> |
+<td>E.g. <a href="http://en.cppreference.com/w/cpp/container/vector/begin">std::vector::cbegin<a> and <a href="http://en.cppreference.com/w/cpp/container/vector/end">std::vector::cend<a></td> |
+<td>Applies to all containers, not just <code>vector</code>. Consider using <code>const_iterator</code> over <code>iterator</code> where possible for the same reason as using <code>const</code> variables and functions where possible; see Effective Modern C++ item 13 for motivation. <a href="https://groups.google.com/a/chromium.org/d/topic/cxx/cS83F_buqLM/discussion">Discussion thread</a></td> |
+</tr> |
+ |
+<tr> |
<td>Containers containing movable types</td> |
<td><code>vector<scoped_ptr></code></td> |
<td>Enables containers that contain move-only types like <code>scoped_ptr</code></td> |
@@ -846,14 +851,6 @@ the <code><complex></code> library.</td> |
</tr> |
<tr> |
-<td>Constant Iterator Methods on Containers</td> |
-<td><code>std::vector::cbegin()</code> and <code>std::vector::cend()</code></td> |
-<td>Enforces iteration methods that don't change container contents</td> |
-<td><a href="http://en.cppreference.com/w/cpp/container/vector/begin">std::vector::cbegin<a></td> |
-<td>This applies to all containers, std::vector is just an example. <a href="https://groups.google.com/a/chromium.org/d/topic/cxx/cS83F_buqLM/discussion">Discussion thread</a></td> |
-</tr> |
- |
-<tr> |
<td>Container Compaction Functions</td> |
<td><code>std::vector::shrink_to_fit()</code>, |
<code>std::deque::shrink_to_fit()</code>, and |