diff options
| author | Wladimir J. van der Laan <[email protected]> | 2018-03-27 18:54:01 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2018-03-27 18:55:09 +0200 |
| commit | 2d97611c41d95d70538e877f5527a30e8e21f9fb (patch) | |
| tree | 20fea595be94849eaa152d4acb2a99bbd820bdfc /doc | |
| parent | Merge #12797: init: Fix help message for checkblockindex (diff) | |
| parent | doc: Add note about our preference for scoped enumerations ("enum class") (diff) | |
| download | discoin-2d97611c41d95d70538e877f5527a30e8e21f9fb.tar.xz discoin-2d97611c41d95d70538e877f5527a30e8e21f9fb.zip | |
Merge #12800: doc: Add note about our preference for scoped enumerations ("enum class")
0fee2b4 doc: Add note about our preference for scoped enumerations ("enum class") (practicalswift)
Pull request description:
Add note about our preference for scoped enumerations (`enum class`).
Context: #10742
Tree-SHA512: 0ab3465c2b734240cb38a05c2f6e75f1af54207a0f1a2e8115e7b367fd37e8966a2fc0240c6d4c2c66b6677b5f367eda4f4b783bbaa419777336c17f04adff06
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/developer-notes.md | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/doc/developer-notes.md b/doc/developer-notes.md index 8f06ee4ec..a152f86e1 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -39,6 +39,7 @@ code. - `++i` is preferred over `i++`. - `nullptr` is preferred over `NULL` or `(void*)0`. - `static_assert` is preferred over `assert` where possible. Generally; compile-time checking is preferred over run-time checking. + - `enum class` is preferred over `enum` where possible. Scoped enumerations avoid two potential pitfalls/problems with traditional C++ enumerations: implicit conversions to int, and name clashes due to enumerators being exported to the surrounding scope. Block style example: ```c++ |