diff options
author | thakis <thakis@chromium.org> | 2014-10-27 21:37:49 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-28 04:38:04 +0000 |
commit | 12bfc7484b420c42d7f5cd9c44b79fe0df9a784c (patch) | |
tree | 8337aeabdde788c872c1f8b901dd7c1aed866b00 /styleguide | |
parent | 22758b88d12e5b6952dea578f5efa17f4d79f0a1 (diff) | |
download | chromium_src-12bfc7484b420c42d7f5cd9c44b79fe0df9a784c.zip chromium_src-12bfc7484b420c42d7f5cd9c44b79fe0df9a784c.tar.gz chromium_src-12bfc7484b420c42d7f5cd9c44b79fe0df9a784c.tar.bz2 |
Update C++11 feature page.
Allow decltype.
Disallow long long, uniform initialization, raw string literals.
BUG=427584
NOTRY=true
Review URL: https://codereview.chromium.org/685663002
Cr-Commit-Position: refs/heads/master@{#301562}
Diffstat (limited to 'styleguide')
-rw-r--r-- | styleguide/c++/c++11.html | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/styleguide/c++/c++11.html b/styleguide/c++/c++11.html index 1cbe001..b62f3c0 100644 --- a/styleguide/c++/c++11.html +++ b/styleguide/c++/c++11.html @@ -84,6 +84,16 @@ Style Guide on <code>auto</code></a>. <a href="https://groups.google.com/a/chrom </tr> <tr> +<td>Declared Type Accessor</td> +<td><code>decltype(<i>expression</i>)</code></td> +<td>Provides a means to determine the type of an expression at compile-time, +useful most often in templates.</td> +<td><a href="http://en.cppreference.com/w/cpp/language/decltype"> +decltype specifier</a></td> +<td>Usage should be rare. <a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/_zoNvZd_dSo">Discussion thread</a></td> +</tr> + +<tr> <td>Enumerated Type Classes</td> <td><code>enum class <i>classname</i></code></td> <td>Provide enums as full classes, with no implicit @@ -231,6 +241,24 @@ The __func__ Predeclared Identifier is Coming to C++</a></td> </tr> <tr> +<td><code>long long</code> Type</td> +<td><code>long long <i>var</i>= <i>value</i>;</code></td> +<td>An integer of at least 64 bits</td> +<td><a href="http://en.cppreference.com/w/cpp/language/types"> +Fundamental types</a></td> +<td>Use an stdint.h type if you need a 64bit number. <a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/RxugZ-pIDxk">Discussion thread</a></td> +</tr> + +<tr> +<td>Raw String Literals</td> +<td><code>string <i>var</i>=R"(<i>raw_string</i>)";</code></td> +<td>Allows a string to be encoded without any escape +sequences, easing parsing in regex expressions, for example</td> +<td>TODO: documentation link</td> +<td>Causes incorrect line numbers in MSVS2014 and gcc. Reevaluate once that works. <a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/2kWQHbbuMHI">Discussion thread</a></td> +</tr> + +<tr> <td>Rvalue References (and Move Semantics)</td> <td><code>T(T&& t)</code> and <code>T& operator=(T&& t)</code></td> <td>Reference that only binds to a temporary object</td> @@ -239,6 +267,15 @@ The __func__ Predeclared Identifier is Coming to C++</a></td> </tr> <tr> +<td>(Uniform) Initialization Syntax</td> +<td><code><i>type</i> <i>name</i> { [<i>value</i> ..., <i>value</i>]};</code></td> +<td>Allows any object of primitive, aggregate or class +type to be initialized using brace syntax</td> +<td>TODO: documentation link</td> +<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/#!topic/chromium-dev/GF96FshwHLw">Discussion thread</a></td> +</tr> + +<tr> <td>UTF-16 and UTF-32 Support (16-Bit and 32-Bit Character Types)</td> <td><code>char16_t</code> and <code>char32_t</code></td> <td>Provides character types for handling 16-bit @@ -306,16 +343,6 @@ C++11 generalized attributes</a></td> </tr> <tr> -<td>Declared Type Accessor</td> -<td><code>decltype(<i>expression</i>)</code></td> -<td>Provides a means to determine the type of an expression at compile-time, -useful most often in templates.</td> -<td><a href="http://en.cppreference.com/w/cpp/language/decltype"> -decltype specifier</a></td> -<td><a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/_zoNvZd_dSo">Discussion thread</a></td> -</tr> - -<tr> <td>Default Function Creation</td> <td><code><i>Function</i>(<i>arguments</i>) = default;</code></td> <td>Instructs the compiler to generate a default version @@ -367,15 +394,6 @@ synthetic function such as a copy constructor</td> </tr> <tr> -<td>(Uniform) Initialization Syntax</td> -<td><code><i>type</i> <i>name</i> { [<i>value</i> ..., <i>value</i>]};</code></td> -<td>Allows any object of primitive, aggregate or class -type to be initialized using brace syntax</td> -<td>TODO: documentation link</td> -<td><a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/GF96FshwHLw">Discussion thread</a></td> -</tr> - -<tr> <td>Inline Namespaces</td> <td><code>inline</code></td> <td>Allows better versioning of namespaces</td> @@ -392,15 +410,6 @@ type to be initialized using brace syntax</td> </tr> <tr> -<td><code>long long</code> Type</td> -<td><code>long long <i>var</i>= <i>value</i>;</code></td> -<td>An integer of at least 64 bits</td> -<td><a href="http://en.cppreference.com/w/cpp/language/types"> -Fundamental types</a></td> -<td><a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/RxugZ-pIDxk">Discussion thread</a></td> -</tr> - -<tr> <td>Non-Static Class Member Initializers</td> <td> <code> @@ -415,15 +424,6 @@ Non-static data members</a></td> </tr> <tr> -<td>Raw String Literals</td> -<td><code>string <i>var</i>=R"(<i>raw_string</i>)";</code></td> -<td>Allows a string to be encoded without any escape -sequences, easing parsing in regex expressions, for example</td> -<td>TODO: documentation link</td> -<td><a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/2kWQHbbuMHI">Discussion thread</a></td> -</tr> - -<tr> <td>Union Class Members</td> <td><code>union <i>name</i> { <i>class</i> <i>var</i>}</code></td> <td>Allows class type members</td> |