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 <link rel="stylesheet" href="c++11.css"> | 10 <link rel="stylesheet" href="c++11.css"> |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 <td>Automatic Types</td> | 77 <td>Automatic Types</td> |
78 <td><code>auto</code></td> | 78 <td><code>auto</code></td> |
79 <td>Automatic type deduction</td> | 79 <td>Automatic type deduction</td> |
80 <td>TODO: documentation link</td> | 80 <td>TODO: documentation link</td> |
81 <td>Use according to the <a | 81 <td>Use according to the <a |
82 href="https://google-styleguide.googlecode.com/svn/trunk/cppguide.html#auto">Goo
gle | 82 href="https://google-styleguide.googlecode.com/svn/trunk/cppguide.html#auto">Goo
gle |
83 Style Guide on <code>auto</code></a>. <a href="https://groups.google.com/a/chrom
ium.org/forum/#!topic/chromium-dev/OQyYSfH9m2M">Discussion thread</a></td> | 83 Style Guide on <code>auto</code></a>. <a href="https://groups.google.com/a/chrom
ium.org/forum/#!topic/chromium-dev/OQyYSfH9m2M">Discussion thread</a></td> |
84 </tr> | 84 </tr> |
85 | 85 |
86 <tr> | 86 <tr> |
| 87 <td>Declared Type Accessor</td> |
| 88 <td><code>decltype(<i>expression</i>)</code></td> |
| 89 <td>Provides a means to determine the type of an expression at compile-time, |
| 90 useful most often in templates.</td> |
| 91 <td><a href="http://en.cppreference.com/w/cpp/language/decltype"> |
| 92 decltype specifier</a></td> |
| 93 <td>Usage should be rare. <a href="https://groups.google.com/a/chromium.org/foru
m/#!topic/chromium-dev/_zoNvZd_dSo">Discussion thread</a></td> |
| 94 </tr> |
| 95 |
| 96 <tr> |
87 <td>Enumerated Type Classes</td> | 97 <td>Enumerated Type Classes</td> |
88 <td><code>enum class <i>classname</i></code></td> | 98 <td><code>enum class <i>classname</i></code></td> |
89 <td>Provide enums as full classes, with no implicit | 99 <td>Provide enums as full classes, with no implicit |
90 conversion to booleans or integers</td> | 100 conversion to booleans or integers</td> |
91 <td><a href="http://stackoverflow.com/questions/6936030/do-we-really-need-enum-c
lass-in-c11"> | 101 <td><a href="http://stackoverflow.com/questions/6936030/do-we-really-need-enum-c
lass-in-c11"> |
92 enum-class</a></td> | 102 enum-class</a></td> |
93 <td>Enum classes are still enums and follow enum naming rules | 103 <td>Enum classes are still enums and follow enum naming rules |
94 (which means SHOUTY_CASE in the <a href="http://www.chromium.org/developers/codi
ng-style#Naming">current style guide</a>). | 104 (which means SHOUTY_CASE in the <a href="http://www.chromium.org/developers/codi
ng-style#Naming">current style guide</a>). |
95 <a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/Q5W
mkAImanc">Discussion thread</a></td> | 105 <a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/Q5W
mkAImanc">Discussion thread</a></td> |
96 </tr> | 106 </tr> |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 <td>Function Local Variable</td> | 234 <td>Function Local Variable</td> |
225 <td><code>__func__</code></td> | 235 <td><code>__func__</code></td> |
226 <td>Provides a local variable of the name of the enclosing | 236 <td>Provides a local variable of the name of the enclosing |
227 function for logging purposes</td> | 237 function for logging purposes</td> |
228 <td><a href="http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=
338"> | 238 <td><a href="http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=
338"> |
229 The __func__ Predeclared Identifier is Coming to C++</a></td> | 239 The __func__ Predeclared Identifier is Coming to C++</a></td> |
230 <td>Doesn't work in MSVS2013. Reevaluate once it does. <a href="https://groups.g
oogle.com/a/chromium.org/forum/#!topic/chromium-dev/ojGfcgSDzHM">Discussion thre
ad</a></td> | 240 <td>Doesn't work in MSVS2013. Reevaluate once it does. <a href="https://groups.g
oogle.com/a/chromium.org/forum/#!topic/chromium-dev/ojGfcgSDzHM">Discussion thre
ad</a></td> |
231 </tr> | 241 </tr> |
232 | 242 |
233 <tr> | 243 <tr> |
| 244 <td><code>long long</code> Type</td> |
| 245 <td><code>long long <i>var</i>= <i>value</i>;</code></td> |
| 246 <td>An integer of at least 64 bits</td> |
| 247 <td><a href="http://en.cppreference.com/w/cpp/language/types"> |
| 248 Fundamental types</a></td> |
| 249 <td>Use an stdint.h type if you need a 64bit number. <a href="https://groups.goo
gle.com/a/chromium.org/forum/#!topic/chromium-dev/RxugZ-pIDxk">Discussion thread
</a></td> |
| 250 </tr> |
| 251 |
| 252 <tr> |
| 253 <td>Raw String Literals</td> |
| 254 <td><code>string <i>var</i>=R"(<i>raw_string</i>)";</code></td> |
| 255 <td>Allows a string to be encoded without any escape |
| 256 sequences, easing parsing in regex expressions, for example</td> |
| 257 <td>TODO: documentation link</td> |
| 258 <td>Causes incorrect line numbers in MSVS2014 and gcc. Reevaluate once that work
s. <a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/
2kWQHbbuMHI">Discussion thread</a></td> |
| 259 </tr> |
| 260 |
| 261 <tr> |
234 <td>Rvalue References (and Move Semantics)</td> | 262 <td>Rvalue References (and Move Semantics)</td> |
235 <td><code>T(T&& t)</code> and <code>T& operator=(T&& t)</cod
e></td> | 263 <td><code>T(T&& t)</code> and <code>T& operator=(T&& t)</cod
e></td> |
236 <td>Reference that only binds to a temporary object</td> | 264 <td>Reference that only binds to a temporary object</td> |
237 <td>TODO: documentation link</td> | 265 <td>TODO: documentation link</td> |
238 <td>To be revisited in the future. Allowed in exceptional cases where approved
by the OWNERS of src/styleguide/c++/.</td> | 266 <td>To be revisited in the future. Allowed in exceptional cases where approved
by the OWNERS of src/styleguide/c++/.</td> |
239 </tr> | 267 </tr> |
240 | 268 |
241 <tr> | 269 <tr> |
| 270 <td>(Uniform) Initialization Syntax</td> |
| 271 <td><code><i>type</i> <i>name</i> { [<i>value</i> ..., <i>value</i>]};</code></t
d> |
| 272 <td>Allows any object of primitive, aggregate or class |
| 273 type to be initialized using brace syntax</td> |
| 274 <td>TODO: documentation link</td> |
| 275 <td>Dangerous without library support, see thread. Reevaulate once we have C++11
library support. <a href="https://groups.google.com/a/chromium.org/forum/#!topi
c/chromium-dev/GF96FshwHLw">Discussion thread</a></td> |
| 276 </tr> |
| 277 |
| 278 <tr> |
242 <td>UTF-16 and UTF-32 Support (16-Bit and 32-Bit Character Types)</td> | 279 <td>UTF-16 and UTF-32 Support (16-Bit and 32-Bit Character Types)</td> |
243 <td><code>char16_t</code> and <code>char32_t</code></td> | 280 <td><code>char16_t</code> and <code>char32_t</code></td> |
244 <td>Provides character types for handling 16-bit | 281 <td>Provides character types for handling 16-bit |
245 and 32-bit code units (useful for encoding | 282 and 32-bit code units (useful for encoding |
246 UTF-16 and UTF-32 string data)</td> | 283 UTF-16 and UTF-32 string data)</td> |
247 <td><a href="http://en.cppreference.com/w/cpp/language/types"> | 284 <td><a href="http://en.cppreference.com/w/cpp/language/types"> |
248 Fundamental types</a></td> | 285 Fundamental types</a></td> |
249 <td>Doesn't work in MSVS2013. Reevaluate once it does. Non-UTF-8 text is | 286 <td>Doesn't work in MSVS2013. Reevaluate once it does. Non-UTF-8 text is |
250 banned by the | 287 banned by the |
251 <a href="https://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Non-AS
CII_Characters"> | 288 <a href="https://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Non-AS
CII_Characters"> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 <td>Attributes</td> | 336 <td>Attributes</td> |
300 <td><code>[[<i>attribute_name</i>]]</code></td> | 337 <td><code>[[<i>attribute_name</i>]]</code></td> |
301 <td>Attaches properties to declarations that | 338 <td>Attaches properties to declarations that |
302 specific compiler implementations may use.</td> | 339 specific compiler implementations may use.</td> |
303 <td><a href="http://www.codesynthesis.com/~boris/blog/2012/04/18/cxx11-generaliz
ed-attributes/"> | 340 <td><a href="http://www.codesynthesis.com/~boris/blog/2012/04/18/cxx11-generaliz
ed-attributes/"> |
304 C++11 generalized attributes</a></td> | 341 C++11 generalized attributes</a></td> |
305 <td></td> | 342 <td></td> |
306 </tr> | 343 </tr> |
307 | 344 |
308 <tr> | 345 <tr> |
309 <td>Declared Type Accessor</td> | |
310 <td><code>decltype(<i>expression</i>)</code></td> | |
311 <td>Provides a means to determine the type of an expression at compile-time, | |
312 useful most often in templates.</td> | |
313 <td><a href="http://en.cppreference.com/w/cpp/language/decltype"> | |
314 decltype specifier</a></td> | |
315 <td><a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev
/_zoNvZd_dSo">Discussion thread</a></td> | |
316 </tr> | |
317 | |
318 <tr> | |
319 <td>Default Function Creation</td> | 346 <td>Default Function Creation</td> |
320 <td><code><i>Function</i>(<i>arguments</i>) = default;</code></td> | 347 <td><code><i>Function</i>(<i>arguments</i>) = default;</code></td> |
321 <td>Instructs the compiler to generate a default version | 348 <td>Instructs the compiler to generate a default version |
322 of the indicated function</td> | 349 of the indicated function</td> |
323 <td><a href="http://stackoverflow.com/questions/823935/whats-the-point-in-defaul
ting-functions-in-c11"> | 350 <td><a href="http://stackoverflow.com/questions/823935/whats-the-point-in-defaul
ting-functions-in-c11"> |
324 What's the point in defaulting functions in C++11?</a></td> | 351 What's the point in defaulting functions in C++11?</a></td> |
325 <td><a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev
/qgU4mh_MpGA">Discussion thread</a></td> | 352 <td><a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev
/qgU4mh_MpGA">Discussion thread</a></td> |
326 </tr> | 353 </tr> |
327 | 354 |
328 <tr> | 355 <tr> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 <tr> | 387 <tr> |
361 <td>Function Suppression</td> | 388 <td>Function Suppression</td> |
362 <td><code><i>Function</i>(<i>arguments</i>) = delete;</code></td> | 389 <td><code><i>Function</i>(<i>arguments</i>) = delete;</code></td> |
363 <td>Suppresses the implementation of a function, especially a | 390 <td>Suppresses the implementation of a function, especially a |
364 synthetic function such as a copy constructor</td> | 391 synthetic function such as a copy constructor</td> |
365 <td>TODO: documentation link</td> | 392 <td>TODO: documentation link</td> |
366 <td><a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev
/i1o7-RNRnMs">Discussion thread</a></td> | 393 <td><a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev
/i1o7-RNRnMs">Discussion thread</a></td> |
367 </tr> | 394 </tr> |
368 | 395 |
369 <tr> | 396 <tr> |
370 <td>(Uniform) Initialization Syntax</td> | |
371 <td><code><i>type</i> <i>name</i> { [<i>value</i> ..., <i>value</i>]};</code></t
d> | |
372 <td>Allows any object of primitive, aggregate or class | |
373 type to be initialized using brace syntax</td> | |
374 <td>TODO: documentation link</td> | |
375 <td><a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev
/GF96FshwHLw">Discussion thread</a></td> | |
376 </tr> | |
377 | |
378 <tr> | |
379 <td>Inline Namespaces</td> | 397 <td>Inline Namespaces</td> |
380 <td><code>inline</code></td> | 398 <td><code>inline</code></td> |
381 <td>Allows better versioning of namespaces</td> | 399 <td>Allows better versioning of namespaces</td> |
382 <td><a href="http://en.cppreference.com/w/cpp/language/namespace">Namespaces</a>
</td> | 400 <td><a href="http://en.cppreference.com/w/cpp/language/namespace">Namespaces</a>
</td> |
383 <td>Unclear how it will work with components</td> | 401 <td>Unclear how it will work with components</td> |
384 </tr> | 402 </tr> |
385 | 403 |
386 <tr> | 404 <tr> |
387 <td>Lambda Expressions</td> | 405 <td>Lambda Expressions</td> |
388 <td><code>[<i>captures</i>](<i>params</i>) -> <i>ret</i> { <i>body</i> }</cod
e></td> | 406 <td><code>[<i>captures</i>](<i>params</i>) -> <i>ret</i> { <i>body</i> }</cod
e></td> |
389 <td>Anonymous functions</td> | 407 <td>Anonymous functions</td> |
390 <td><a href="http://en.cppreference.com/w/cpp/language/lambda">Lambda functions<
/a></td> | 408 <td><a href="http://en.cppreference.com/w/cpp/language/lambda">Lambda functions<
/a></td> |
391 <td>No default captures (<a href="https://google-styleguide.googlecode.com/svn/t
runk/cppguide.html#Lambda_expressions">Google Style Guide</a>). <a href="https:/
/groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/D9UnnxBnciQ">Discus
sion thread</a></td> | 409 <td>No default captures (<a href="https://google-styleguide.googlecode.com/svn/t
runk/cppguide.html#Lambda_expressions">Google Style Guide</a>). <a href="https:/
/groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/D9UnnxBnciQ">Discus
sion thread</a></td> |
392 </tr> | 410 </tr> |
393 | 411 |
394 <tr> | 412 <tr> |
395 <td><code>long long</code> Type</td> | |
396 <td><code>long long <i>var</i>= <i>value</i>;</code></td> | |
397 <td>An integer of at least 64 bits</td> | |
398 <td><a href="http://en.cppreference.com/w/cpp/language/types"> | |
399 Fundamental types</a></td> | |
400 <td><a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev
/RxugZ-pIDxk">Discussion thread</a></td> | |
401 </tr> | |
402 | |
403 <tr> | |
404 <td>Non-Static Class Member Initializers</td> | 413 <td>Non-Static Class Member Initializers</td> |
405 <td> | 414 <td> |
406 <code> | 415 <code> |
407 class C {<br /> | 416 class C {<br /> |
408 <i>type</i> <i>var</i> = <i>value</i>;<br/> | 417 <i>type</i> <i>var</i> = <i>value</i>;<br/> |
409 C() // copy-initializes <i>var</i><br/> | 418 C() // copy-initializes <i>var</i><br/> |
410 </code> | 419 </code> |
411 <td>Allows non-static class members to be initialized at their definitions (outs
ide constructors)</td> | 420 <td>Allows non-static class members to be initialized at their definitions (outs
ide constructors)</td> |
412 <td><a href="http://en.cppreference.com/w/cpp/language/data_members"> | 421 <td><a href="http://en.cppreference.com/w/cpp/language/data_members"> |
413 Non-static data members</a></td> | 422 Non-static data members</a></td> |
414 <td><a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev
/zqB-DySA4V0">Discussion thread</a></td> | 423 <td><a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev
/zqB-DySA4V0">Discussion thread</a></td> |
415 </tr> | 424 </tr> |
416 | 425 |
417 <tr> | 426 <tr> |
418 <td>Raw String Literals</td> | |
419 <td><code>string <i>var</i>=R"(<i>raw_string</i>)";</code></td> | |
420 <td>Allows a string to be encoded without any escape | |
421 sequences, easing parsing in regex expressions, for example</td> | |
422 <td>TODO: documentation link</td> | |
423 <td><a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev
/2kWQHbbuMHI">Discussion thread</a></td> | |
424 </tr> | |
425 | |
426 <tr> | |
427 <td>Union Class Members</td> | 427 <td>Union Class Members</td> |
428 <td><code>union <i>name</i> { <i>class</i> <i>var</i>}</code></td> | 428 <td><code>union <i>name</i> { <i>class</i> <i>var</i>}</code></td> |
429 <td>Allows class type members</td> | 429 <td>Allows class type members</td> |
430 <td><a href="http://en.cppreference.com/w/cpp/language/union"> | 430 <td><a href="http://en.cppreference.com/w/cpp/language/union"> |
431 Union declarations</a></td> | 431 Union declarations</a></td> |
432 <td></td> | 432 <td></td> |
433 </tr> | 433 </tr> |
434 | 434 |
435 <tr> | 435 <tr> |
436 <td>User-Defined Literals</td> | 436 <td>User-Defined Literals</td> |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 </tr> | 943 </tr> |
944 | 944 |
945 </tbody> | 945 </tbody> |
946 </table> | 946 </table> |
947 | 947 |
948 </details> | 948 </details> |
949 | 949 |
950 </div> | 950 </div> |
951 </body> | 951 </body> |
952 </html> | 952 </html> |
OLD | NEW |