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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 <td><a href="http://en.cppreference.com/w/cpp/language/range-for">Range-based fo
r loop</a></td> | 233 <td><a href="http://en.cppreference.com/w/cpp/language/range-for">Range-based fo
r loop</a></td> |
234 <td>As a rule of thumb, use <code>for (const auto& ...)</code>, <code>for (auto&
...)</code>, or <code>for (<i>concrete type</i> ...)</code>. For pointers, use
<code>for (auto* ...)</code> to make clear that the copy of the loop variable is
intended, and only a pointer is copied. <a href="https://groups.google.com/a/ch
romium.org/forum/#!topic/chromium-dev/hpzz4EqbVmc">Discussion thread</a></td> | 234 <td>As a rule of thumb, use <code>for (const auto& ...)</code>, <code>for (auto&
...)</code>, or <code>for (<i>concrete type</i> ...)</code>. For pointers, use
<code>for (auto* ...)</code> to make clear that the copy of the loop variable is
intended, and only a pointer is copied. <a href="https://groups.google.com/a/ch
romium.org/forum/#!topic/chromium-dev/hpzz4EqbVmc">Discussion thread</a></td> |
235 </tr> | 235 </tr> |
236 | 236 |
237 <tr> | 237 <tr> |
238 <td>Rvalue References</td> | 238 <td>Rvalue References</td> |
239 <td><code>T(T&& t)</code> and <code>T& operator=(T&& t)<br/>
<br/> | 239 <td><code>T(T&& t)</code> and <code>T& operator=(T&& t)<br/>
<br/> |
240 template <typename T><br/>void Function(T&& t) { ... }</code></td> | 240 template <typename T><br/>void Function(T&& t) { ... }</code></td> |
241 <td>Reference that only binds to a temporary object</td> | 241 <td>Reference that only binds to a temporary object</td> |
242 <td><a href="http://en.cppreference.com/w/cpp/language/references#Rvalue_referen
ces">Rvalue references</a></td> | 242 <td><a href="http://en.cppreference.com/w/cpp/language/references#Rvalue_referen
ces">Rvalue references</a></td> |
243 <td>As per the <a href="https://google.github.io/styleguide/cppguide.html#Rvalue
_references">Google Style Guide</a>: Only use these to define move constructors
and move assignment operators, and for perfect forwarding. Most classes should n
ot be copyable, even if movable. Continue to use DISALLOW_COPY_AND_ASSIGN in mos
t cases. <a href="https://groups.google.com/a/chromium.org/d/topic/chromium-dev/
UnRaORb4TSw">Discussion thread</a>. <a href="https://groups.google.com/a/chromiu
m.org/d/topic/cxx/Q526tkruXpM">Another discussion thread</a>.</td> | 243 <td>As per the <a href="https://google.github.io/styleguide/cppguide.html#Rvalue
_references">Google Style Guide</a>: Only use these to define move constructors
and move assignment operators, and for perfect forwarding. Most classes should n
ot be copyable, even if movable. Continue to use DISALLOW_COPY_AND_ASSIGN (or DI
SALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND if needed) in most cases. <a href="htt
ps://groups.google.com/a/chromium.org/d/topic/chromium-dev/UnRaORb4TSw">Discussi
on thread</a>. <a href="https://groups.google.com/a/chromium.org/d/topic/cxx/Q52
6tkruXpM">Another discussion thread</a>.</td> |
244 </tr> | 244 </tr> |
245 | 245 |
246 <tr> | 246 <tr> |
247 <td>Standard Integers</td> | 247 <td>Standard Integers</td> |
248 <td>Typedefs within <code><stdint.h></code> and <code><inttypes></co
de></td> | 248 <td>Typedefs within <code><stdint.h></code> and <code><inttypes></co
de></td> |
249 <td>Provides fixed-size integers independent of platforms</td> | 249 <td>Provides fixed-size integers independent of platforms</td> |
250 <td><a href="http://www.cplusplus.com/reference/cstdint/"><stdint.h> (cstd
int)</a></td> | 250 <td><a href="http://www.cplusplus.com/reference/cstdint/"><stdint.h> (cstd
int)</a></td> |
251 <td>Already in common use in the codebase. Approved without discussion.</td> | 251 <td>Already in common use in the codebase. Approved without discussion.</td> |
252 </tr> | 252 </tr> |
253 | 253 |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 <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> | 917 <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> |
918 <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> | 918 <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> |
919 </tr> | 919 </tr> |
920 | 920 |
921 </tbody> | 921 </tbody> |
922 </table> | 922 </table> |
923 | 923 |
924 </div> | 924 </div> |
925 </body> | 925 </body> |
926 </html> | 926 </html> |
OLD | NEW |