aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/developer-notes.md20
1 files changed, 12 insertions, 8 deletions
diff --git a/doc/developer-notes.md b/doc/developer-notes.md
index 583c50a763..3e13adeec0 100644
--- a/doc/developer-notes.md
+++ b/doc/developer-notes.md
@@ -89,6 +89,10 @@ code.
- Class member variables have a `m_` prefix.
- Global variables have a `g_` prefix.
- Constant names are all uppercase, and use `_` to separate words.
+ - Enumerator constants may be `snake_case`, `PascalCase` or `ALL_CAPS`.
+ This is a more tolerant policy than the [C++ Core
+ Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Renum-caps),
+ which recommend using `snake_case`. Please use what seems appropriate.
- Class names, function names, and method names are UpperCamelCase
(PascalCase). Do not prefix class names with `C`.
- Test suite naming convention: The Boost test suite in file
@@ -669,19 +673,19 @@ Foo(vec);
```cpp
enum class Tabs {
- INFO,
- CONSOLE,
- GRAPH,
- PEERS
+ info,
+ console,
+ network_graph,
+ peers
};
int GetInt(Tabs tab)
{
switch (tab) {
- case Tabs::INFO: return 0;
- case Tabs::CONSOLE: return 1;
- case Tabs::GRAPH: return 2;
- case Tabs::PEERS: return 3;
+ case Tabs::info: return 0;
+ case Tabs::console: return 1;
+ case Tabs::network_graph: return 2;
+ case Tabs::peers: return 3;
} // no default case, so the compiler can warn about missing cases
assert(false);
}