diff options
Diffstat (limited to 'docs/cpp-code-standards.md')
| -rw-r--r-- | docs/cpp-code-standards.md | 13 |
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. |
