-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
I'm seeing engineers define enums like the following:
enum MyEnum : U8 {
OPTION_A
OPTION_B
OPTION_C
NUM_OPTIONS
}
Of course, NUM_OPTIONS isn't supposed to be a valid choice for this enum... but the engineer wants the ability to use the number of values in the enum in a port array definition:
output port myPort: [MyEnum.NUM_OPTIONS] MyPort
If we were writing C++, we could use MyEnum::NUM_CONSTANTS to find the number of options, and we wouldn't need to define NUM_OPTIONS. But we can't write MyEnum.NUM_CONSTANTS in fpp; the symbol is undefined.
I'd like for us to consider allowing FPP code to access the same NUM_CONSTANTS field that is available in the generated HPP.
Kronos3
Metadata
Metadata
Assignees
Labels
No labels