diff options
author | thakis <thakis@chromium.org> | 2014-10-28 18:30:42 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-29 01:31:01 +0000 |
commit | b8fbe312fb52b02c80e0cf5b2c6b806f7b894e22 (patch) | |
tree | 25eaa8697c40c2321ba31141c1642543daf1279b /styleguide | |
parent | 3edd4d5d972d3820ec22cebd011ecbd9d4841143 (diff) | |
download | chromium_src-b8fbe312fb52b02c80e0cf5b2c6b806f7b894e22.zip chromium_src-b8fbe312fb52b02c80e0cf5b2c6b806f7b894e22.tar.gz chromium_src-b8fbe312fb52b02c80e0cf5b2c6b806f7b894e22.tar.bz2 |
Clarify that enum classes include explicit underlying types.
Also use that in one place to forward-declare an enum, to make sure it actually
works. No behavior change.
BUG=none
Review URL: https://codereview.chromium.org/678333004
Cr-Commit-Position: refs/heads/master@{#301766}
Diffstat (limited to 'styleguide')
-rw-r--r-- | styleguide/c++/c++11.html | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/styleguide/c++/c++11.html b/styleguide/c++/c++11.html index b62f3c0..c0274d9 100644 --- a/styleguide/c++/c++11.html +++ b/styleguide/c++/c++11.html @@ -94,12 +94,14 @@ decltype specifier</a></td> </tr> <tr> -<td>Enumerated Type Classes</td> -<td><code>enum class <i>classname</i></code></td> +<td>Enumerated Type Classes and Enum Bases</td> +<td><code>enum class <i>classname</i></code><br> + <code>enum class <i>classname</i> : <i>base-type</i></code><br> + <code>enum <i>enumname</i> : <i>base-type</i></code></td> <td>Provide enums as full classes, with no implicit -conversion to booleans or integers</td> -<td><a href="http://stackoverflow.com/questions/6936030/do-we-really-need-enum-class-in-c11"> -enum-class</a></td> +conversion to booleans or integers. Provide an explicit underlying type for +enum classes and regular enums.</td> +<td><a href="http://www.stroustrup.com/C++11FAQ.html#enum">enum-class</a></td> <td>Enum classes are still enums and follow enum naming rules (which means SHOUTY_CASE in the <a href="http://www.chromium.org/developers/coding-style#Naming">current style guide</a>). <a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/Q5WmkAImanc">Discussion thread</a></td> |