I'm not able to compile the following program:
#include <iostream>
using namespace std;
enum class my_enum
{
ANT,
BAT,
CAT,
DOG,
EGG,
FAN,
MAX_MEMBERS
};
int main(int argc, char * argv[])
{
my_enum i = my_enum::ANT;
for(i = my_enum::ANT; i < my_enum::MAX_MEMBERS; i++)
{
cout << "Enum value = " << i << endl;
}
return 0;
}
I see the build error as follows:
error: no ‘operator++(int)’ declared for postfix ‘++’ [-fpermissive] for(i = my_enum::ANT; i < my_enum::MAX_MEMBERS; i++)