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

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

Issue 2844443002: Remove warning about std::map::emplace (Closed)
Patch Set: Created 3 years, 8 months 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
« base/containers/mru_cache.h ('K') | « base/containers/mru_cache.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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 <td>Converts a type to a reference of the type to allow use of members of the ty pe without constructing it in templates.</td> 397 <td>Converts a type to a reference of the type to allow use of members of the ty pe without constructing it in templates.</td>
398 <td><a href="http://en.cppreference.com/w/cpp/utility/declval">std::declval</a>< /td> 398 <td><a href="http://en.cppreference.com/w/cpp/utility/declval">std::declval</a>< /td>
399 <td>Usage should be rare. <a href="https://groups.google.com/a/chromium.org/d/to pic/cxx/ku6lYjk0-OU/discussion">Discussion thread</a></td> 399 <td>Usage should be rare. <a href="https://groups.google.com/a/chromium.org/d/to pic/cxx/ku6lYjk0-OU/discussion">Discussion thread</a></td>
400 </tr> 400 </tr>
401 401
402 <tr> 402 <tr>
403 <td>Emplacement methods for containers</td> 403 <td>Emplacement methods for containers</td>
404 <td><code>emplace()</code>, <code>emplace_back()</code>, <code>emplace_front()</ code>, <code>emplace_hint()</code></td> 404 <td><code>emplace()</code>, <code>emplace_back()</code>, <code>emplace_front()</ code>, <code>emplace_hint()</code></td>
405 <td>Constructs elements directly within a container without a copy or a move. Le ss verbose than <code>push_back()</code> due to not naming the type being constr ucted.</td> 405 <td>Constructs elements directly within a container without a copy or a move. Le ss verbose than <code>push_back()</code> due to not naming the type being constr ucted.</td>
406 <td>E.g. <a href="http://en.cppreference.com/w/cpp/container/vector/emplace_back ">std::vector::emplace_back</a></td> 406 <td>E.g. <a href="http://en.cppreference.com/w/cpp/container/vector/emplace_back ">std::vector::emplace_back</a></td>
407 <td><code>std::map::emplace()</code> is not yet available on all libstdc++ versi ons we support. When using emplacement for performance reasons, your type should probably be movable (since e.g. a vector of it might be resized); given a movab le type, then, consider whether you really need to avoid the move done by <code> push_back()</code>. For readability concerns, treat like <code>auto</code>; some times the brevity over <code>push_back()</code> is a win, sometimes a loss. <a h ref="https://groups.google.com/a/chromium.org/forum/#!topic/cxx/m3cblzEta7A">Dis cussion thread</a></td> 407 <td>When using emplacement for performance reasons, your type should probably be movable (since e.g. a vector of it might be resized); given a movable type, the n, consider whether you really need to avoid the move done by <code>push_back()< /code>. For readability concerns, treat like <code>auto</code>; sometimes the br evity over <code>push_back()</code> is a win, sometimes a loss. <a href="https:/ /groups.google.com/a/chromium.org/forum/#!topic/cxx/m3cblzEta7A">Discussion thre ad</a></td>
408 </tr> 408 </tr>
409 409
410 <tr> 410 <tr>
411 <td>Forwarding references</td> 411 <td>Forwarding references</td>
412 <td><code>std::forward()</code></td> 412 <td><code>std::forward()</code></td>
413 <td>Perfectly forwards arguments (including rvalues)</td> 413 <td>Perfectly forwards arguments (including rvalues)</td>
414 <td><a href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>< /td> 414 <td><a href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>< /td>
415 <td>Allowed, though usage should be rare (primarily for forwarding constructor a rguments, or in carefully reviewed library code). <a href="https://groups.google .com/a/chromium.org/forum/#!topic/cxx/-O7euklhSxs">Discussion thread</a> 415 <td>Allowed, though usage should be rare (primarily for forwarding constructor a rguments, or in carefully reviewed library code). <a href="https://groups.google .com/a/chromium.org/forum/#!topic/cxx/-O7euklhSxs">Discussion thread</a>
416 </td> 416 </td>
417 </tr> 417 </tr>
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 <td><a href="http://en.cppreference.com/w/cpp/locale/wstring_convert">std::wstri ng_convert</a>, <a href="http://en.cppreference.com/w/cpp/locale/wbuffer_convert ">std::wbuffer_convert</a>, <a href="http://en.cppreference.com/w/cpp/locale/cod ecvt_utf8">std::codecvt_utf8</a>, <a href="http://en.cppreference.com/w/cpp/loca le/codecvt_utf16">std::codecvt_utf16</a>, <a href="http://en.cppreference.com/w/ cpp/locale/codecvt_utf8_utf16">std::codecvt_utf8_utf16</a></td> 920 <td><a href="http://en.cppreference.com/w/cpp/locale/wstring_convert">std::wstri ng_convert</a>, <a href="http://en.cppreference.com/w/cpp/locale/wbuffer_convert ">std::wbuffer_convert</a>, <a href="http://en.cppreference.com/w/cpp/locale/cod ecvt_utf8">std::codecvt_utf8</a>, <a href="http://en.cppreference.com/w/cpp/loca le/codecvt_utf16">std::codecvt_utf16</a>, <a href="http://en.cppreference.com/w/ cpp/locale/codecvt_utf8_utf16">std::codecvt_utf8_utf16</a></td>
921 <td>Non-UTF-8 text is banned by the <a href="https://google.github.io/styleguide /cppguide.html#Non-ASCII_Characters">Google Style Guide</a>. However, may be use ful for consuming non-ASCII data.</td> 921 <td>Non-UTF-8 text is banned by the <a href="https://google.github.io/styleguide /cppguide.html#Non-ASCII_Characters">Google Style Guide</a>. However, may be use ful for consuming non-ASCII data.</td>
922 </tr> 922 </tr>
923 923
924 </tbody> 924 </tbody>
925 </table> 925 </table>
926 926
927 </div> 927 </div>
928 </body> 928 </body>
929 </html> 929 </html>
OLDNEW
« base/containers/mru_cache.h ('K') | « base/containers/mru_cache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698