I am reading an enum value from a binary file and would like to check if the value is really part of the enum values. How can I do it?
enum
The only way I ever found to make it 'easy', was to create (macro) a sorted array of the enums and checking with that.
The switch trick fail with enums because an enum may have more than one enumerator with a given value.
switch
It's an annoying issue, really.