From e659bde4240bf106a4c3fa17062335d740e18105 Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Thu, 5 Dec 2019 17:54:38 +0100 Subject: [PATCH] Add macro `BETTER_ENUMS_CLASS_ATTRIBUTE` for adding attributes to enum class. When not set it defaults to empty macro. --- enum.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/enum.h b/enum.h index 28d791b..f3d6e79 100644 --- a/enum.h +++ b/enum.h @@ -608,6 +608,10 @@ constexpr const char *_final_ ## index = \ #endif +#ifndef BETTER_ENUMS_CLASS_ATTRIBUTE +# define BETTER_ENUMS_CLASS_ATTRIBUTE +#endif + #define BETTER_ENUMS_TYPE(SetUnderlyingType, SwitchType, GenerateSwitchType, \ GenerateStrings, ToStringConstexpr, \ DeclareInitialize, DefineInitialize, CallInitialize, \ @@ -619,7 +623,7 @@ BETTER_ENUMS_ID(GenerateSwitchType(Underlying, __VA_ARGS__)) \ \ } \ \ -class Enum { \ +class BETTER_ENUMS_CLASS_ATTRIBUTE Enum { \ private: \ typedef ::better_enums::optional _optional; \ typedef ::better_enums::optional _optional_index; \