aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpracticalswift <[email protected]>2018-03-27 17:00:03 +0200
committerpracticalswift <[email protected]>2018-03-27 17:18:32 +0200
commit0fee2b4180815628bd9be03bbb0217e3f8515b57 (patch)
tree20fea595be94849eaa152d4acb2a99bbd820bdfc
parentMerge #12797: init: Fix help message for checkblockindex (diff)
downloaddiscoin-0fee2b4180815628bd9be03bbb0217e3f8515b57.tar.xz
discoin-0fee2b4180815628bd9be03bbb0217e3f8515b57.zip
doc: Add note about our preference for scoped enumerations ("enum class")
-rw-r--r--doc/developer-notes.md1
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++