OLD | NEW |
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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 </td> | 350 </td> |
351 <td>Safe and performant implementations of common algorithms</td> | 351 <td>Safe and performant implementations of common algorithms</td> |
352 <td><a href="http://en.cppreference.com/w/cpp/header/algorithm"><code><algori
thm></code></a></td> | 352 <td><a href="http://en.cppreference.com/w/cpp/header/algorithm"><code><algori
thm></code></a></td> |
353 <td><a href="https://groups.google.com/a/chromium.org/forum/#!topic/cxx/UJQk8S1I
uHk">Discussion thread</a><br/> | 353 <td><a href="https://groups.google.com/a/chromium.org/forum/#!topic/cxx/UJQk8S1I
uHk">Discussion thread</a><br/> |
354 Note that <algorithm> contains a range-based <code>move</code> method. Th
is is allowed, but because people may confuse it with the single-arg <code>std::
move</code>, there is often a way to write code without it that is more readable
. <a href='https://groups.google.com/a/chromium.org/forum/#!topic/cxx/8WzmtYrZv
Q8'>Discussion thread</a></td> | 354 Note that <algorithm> contains a range-based <code>move</code> method. Th
is is allowed, but because people may confuse it with the single-arg <code>std::
move</code>, there is often a way to write code without it that is more readable
. <a href='https://groups.google.com/a/chromium.org/forum/#!topic/cxx/8WzmtYrZv
Q8'>Discussion thread</a></td> |
355 </tr> | 355 </tr> |
356 | 356 |
357 <tr> | 357 <tr> |
358 <td>Begin and End Non-Member Functions</td> | 358 <td>Begin and End Non-Member Functions</td> |
359 <td><code>std::begin()</code> and <code>std::end()</code></td> | 359 <td><code>std::begin()</code> and <code>std::end()</code></td> |
360 <td>Allows use of free functions on any container, including | 360 <td>Allows use of free functions on any container, including fixed-size arrays</
td> |
361 fixed-size arrays</td> | 361 <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> |
362 <td><a href="http://en.cppreference.com/w/cpp/iterator/begin"> | 362 <td>Useful for fixed-size arrays. <a href="https://groups.google.com/a/chromium.
org/d/topic/cxx/5iFNE8P5qT4/discussion">Discussion thread</a><br> |
363 std::begin</a> and | 363 Note that non-member <code>cbegin()</code> and <code>cend()</code> are not avail
able until C++14.</td> |
364 <a href="http://en.cppreference.com/w/cpp/iterator/end"> | |
365 std::end</a></td> | |
366 <td>Useful for fixed-size arrays. <a href="https://groups.google.com/a/chromium.
org/d/topic/cxx/5iFNE8P5qT4/discussion">Discussion thread</a></td> | |
367 </tr> | 364 </tr> |
368 | 365 |
369 <tr> | 366 <tr> |
370 <td>Conditional Type Selection</td> | 367 <td>Conditional Type Selection</td> |
371 <td><code>std::enable_if</code> and <code>std::conditional</code></td> | 368 <td><code>std::enable_if</code> and <code>std::conditional</code></td> |
372 <td>Enables compile-time conditional type selection</td> | 369 <td>Enables compile-time conditional type selection</td> |
373 <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> | 370 <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> |
374 <td>Usage should be rare. <a href='https://groups.google.com/a/chromium.org/foru
m/#!topic/cxx/vCxo4tZNd_M'>Discussion thread</a></td> | 371 <td>Usage should be rare. <a href='https://groups.google.com/a/chromium.org/foru
m/#!topic/cxx/vCxo4tZNd_M'>Discussion thread</a></td> |
375 </tr> | 372 </tr> |
376 | 373 |
377 <tr> | 374 <tr> |
| 375 <td>Constant Iterator Methods on Containers</td> |
| 376 <td><code>std::vector::cbegin()</code>, <code>std::vector::cend()</code></td> |
| 377 <td>Allows more widespread use of <code>const_iterator</code></td> |
| 378 <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> |
| 379 <td>Applies to all containers, not just <code>vector</code>. Consider using <co
de>const_iterator</code> over <code>iterator</code> where possible for the same
reason as using <code>const</code> variables and functions where possible; see E
ffective 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> |
| 380 </tr> |
| 381 |
| 382 <tr> |
378 <td>Containers containing movable types</td> | 383 <td>Containers containing movable types</td> |
379 <td><code>vector<scoped_ptr></code></td> | 384 <td><code>vector<scoped_ptr></code></td> |
380 <td>Enables containers that contain move-only types like <code>scoped_ptr</code>
</td> | 385 <td>Enables containers that contain move-only types like <code>scoped_ptr</code>
</td> |
381 <td>TODO</td> | 386 <td>TODO</td> |
382 <td>Allows getting rid of <a href="http://crbug.com/554289">ScopedVector</a></td
> | 387 <td>Allows getting rid of <a href="http://crbug.com/554289">ScopedVector</a></td
> |
383 </tr> | 388 </tr> |
384 | 389 |
385 <tr> | 390 <tr> |
386 <td>Emplacement methods for containers</td> | 391 <td>Emplacement methods for containers</td> |
387 <td><code>emplace()</code>, <code>emplace_back()</code>, <code>emplace_front()</
code>, <code>emplace_hint()</code></td> | 392 <td><code>emplace()</code>, <code>emplace_back()</code>, <code>emplace_front()</
code>, <code>emplace_hint()</code></td> |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 <tr> | 844 <tr> |
840 <td>Complex Inverse Trigonometric and Hyperbolic Functions</td> | 845 <td>Complex Inverse Trigonometric and Hyperbolic Functions</td> |
841 <td>Functions within <code><complex></code></td> | 846 <td>Functions within <code><complex></code></td> |
842 <td>Adds inverse trigonomentric and hyperbolic non-member functions to | 847 <td>Adds inverse trigonomentric and hyperbolic non-member functions to |
843 the <code><complex></code> library.</td> | 848 the <code><complex></code> library.</td> |
844 <td><a href="http://en.cppreference.com/w/cpp/numeric/complex">std::complex</a><
/td> | 849 <td><a href="http://en.cppreference.com/w/cpp/numeric/complex">std::complex</a><
/td> |
845 <td></td> | 850 <td></td> |
846 </tr> | 851 </tr> |
847 | 852 |
848 <tr> | 853 <tr> |
849 <td>Constant Iterator Methods on Containers</td> | |
850 <td><code>std::vector::cbegin()</code> and <code>std::vector::cend()</code></td> | |
851 <td>Enforces iteration methods that don't change container contents</td> | |
852 <td><a href="http://en.cppreference.com/w/cpp/container/vector/begin">std::vecto
r::cbegin<a></td> | |
853 <td>This applies to all containers, std::vector is just an example. <a href="htt
ps://groups.google.com/a/chromium.org/d/topic/cxx/cS83F_buqLM/discussion">Discus
sion thread</a></td> | |
854 </tr> | |
855 | |
856 <tr> | |
857 <td>Container Compaction Functions</td> | 854 <td>Container Compaction Functions</td> |
858 <td><code>std::vector::shrink_to_fit()</code>, | 855 <td><code>std::vector::shrink_to_fit()</code>, |
859 <code>std::deque::shrink_to_fit()</code>, and | 856 <code>std::deque::shrink_to_fit()</code>, and |
860 <code>std::string::shrink_to_fit()</code></td> | 857 <code>std::string::shrink_to_fit()</code></td> |
861 <td>Requests the removal of unused space | 858 <td>Requests the removal of unused space |
862 in the container</td> | 859 in the container</td> |
863 <td><a href="http://en.cppreference.com/w/cpp/container/vector/shrink_to_fit"> | 860 <td><a href="http://en.cppreference.com/w/cpp/container/vector/shrink_to_fit"> |
864 std::vector::shrink_to_fit</a>, | 861 std::vector::shrink_to_fit</a>, |
865 <a href="http://en.cppreference.com/w/cpp/container/deque/shrink_to_fit"> | 862 <a href="http://en.cppreference.com/w/cpp/container/deque/shrink_to_fit"> |
866 std::deque::shrink_to_fit</a>, and | 863 std::deque::shrink_to_fit</a>, and |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1110 C++ Style Guide</a>. However, may be useful for | 1107 C++ Style Guide</a>. However, may be useful for |
1111 consuming non-ASCII data.</td> | 1108 consuming non-ASCII data.</td> |
1112 </tr> | 1109 </tr> |
1113 | 1110 |
1114 </tbody> | 1111 </tbody> |
1115 </table> | 1112 </table> |
1116 | 1113 |
1117 </div> | 1114 </div> |
1118 </body> | 1115 </body> |
1119 </html> | 1116 </html> |
OLD | NEW |