I'm writing a simple Naive Bayes image classifier in C++. I'd like to parametrize it by two enum class
types (one for the type of input pixels, one for the class of the image). The problem is that part of the spec requires me to be able to write the classifier to a file, so I need to be able to get the integer values of all elements in the enum classes in question. This, of course, requires me to get all the values from the enum classes in question.
In Java, I can write
EnumSet.allOf(PixelTypeEnum.class)
to get a set containing every element of the enum class. Is there a similar idiom in C++?