From 1b41448298568539c75c9964207b1daf6552359a Mon Sep 17 00:00:00 2001 From: Herb Sutter Date: Thu, 13 Apr 2023 14:51:03 -0700 Subject: [PATCH] List some non-enum alternatives to macros in Enum.1, closes #2054 --- CppCoreGuidelines.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 8dcbf8d..0d80405 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -9070,9 +9070,13 @@ Instead use an `enum`: We used an `enum class` to avoid name clashes. +##### Note + +Also consider `constexpr` and `const inline` variables. + ##### Enforcement -Flag macros that define integer values. +Flag macros that define integer values. Use `enum` or `const inline` or another non-macro alternative instead. ### Enum.2: Use enumerations to represent sets of related named constants