summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorKitzunu <24550914+Kitzunu@users.noreply.github.com>2021-09-28 18:06:56 +0200
committerGitHub <noreply@github.com>2021-09-28 18:06:56 +0200
commitf7eab25947d3e1f8164d8091596dab0214dd9c34 (patch)
tree455a2190679556cfa66f3324f88099d54dc8d362 /docs
parent2868fb845cad4f6d4e1f174dddf7116e6587ee7e (diff)
downloadwiki-f7eab25947d3e1f8164d8091596dab0214dd9c34.tar.gz
wiki-f7eab25947d3e1f8164d8091596dab0214dd9c34.tar.bz2
wiki-f7eab25947d3e1f8164d8091596dab0214dd9c34.zip
chore: enum class > enum
Diffstat (limited to 'docs')
-rw-r--r--docs/cpp-code-standards.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/cpp-code-standards.md b/docs/cpp-code-standards.md
index 5d5128c..46102b3 100644
--- a/docs/cpp-code-standards.md
+++ b/docs/cpp-code-standards.md
@@ -121,6 +121,19 @@ enum Spells
constexpr uint32 SPELL_4 = 4444;
```
+### Enum vs. Enum Class
+
+Enum classes are prefered to be used as they can cause fewer suprises that could lead to bugs as the enum will not implicitly convert to other types like integer or other enums.
+
+```cpp
+enum class Spell : uint32
+{
+ One = 1111,
+ Two = 2222,
+ Three = 3333
+}
+```
+
### Standard prefixes for constants
All constants that we store have a standardized prefix.