95
No, there is no way to find the maximum and minimum defined values of any enum in C++. When this kind of information is needed, it is often good practice to define a Last and First value. For example,
enum MyPretendEnum
{
Apples,
Oranges,
Pears,
Bananas,
First = Apples,
Last = Bananas
};
There do not need to be named values for every value between First and Last.
you don't even need them, what I do is just I say for example if you have:
enum Name{val0,val1,val2};
if you have switch statement and to check if the last value was reached do as the following:
if(selectedOption>=val0 && selectedOption<=val2){
//code
}