diff --git a/enum.h b/enum.h index 0ba3ad4..2eb0972 100644 --- a/enum.h +++ b/enum.h @@ -644,9 +644,9 @@ class Enum { \ \ _integral _value; \ \ - private: \ - Enum() : _value(0) { } \ + BETTER_ENUMS_DEFAULT_CONSTRUCTOR(Enum) \ \ + private: \ explicit BETTER_ENUMS__CONSTEXPR Enum(const _integral &value) : \ _value(value) { } \ \ @@ -997,6 +997,14 @@ BETTER_ENUMS__CONSTEXPR inline bool operator >=(const Enum &a, const Enum &b) \ +#ifndef BETTER_ENUMS_DEFAULT_CONSTRUCTOR +# define BETTER_ENUMS_DEFAULT_CONSTRUCTOR(Enum) \ + private: \ + Enum() { } +#endif + + + #ifdef BETTER_ENUMS__HAVE_CONSTEXPR #ifdef BETTER_ENUMS_CONSTEXPR_TO_STRING