We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 889f671 commit a027c45Copy full SHA for a027c45
1 file changed
include/fixed_containers/enum_utils.hpp
@@ -373,7 +373,9 @@ using RichEnumStorage = std::conditional_t<std::is_same_v<std::underlying_type_t
373
#define FIXED_CONTAINERS_RICH_ENUM_CONSTANT_GEN_HELPER(RichEnumName, CONSTANT_NAME) \
374
static constexpr RichEnumName CONSTANT_NAME() /* NOLINT(readability-identifier-naming) */ \
375
{ \
376
- return RichEnumName::value_of(BackingEnum::CONSTANT_NAME).value(); \
+ const auto& value_of = RichEnumName::value_of(BackingEnum::CONSTANT_NAME); \
377
+ ::fixed_containers::assert_or_abort(value_of.has_value()); \
378
+ return value_of.value(); \
379
}
380
381
namespace fixed_containers::rich_enums
0 commit comments